Beispiel #1
0
 def sql(self, command, query_on_ddf=True):
     """
     Execute a sql command and return a list of strings
     :param command: the sql command to run
     :param query_on_ddf: whether the query is on ddf or on the origianl engine
     """
     command = command.strip()
     res = self._jdm.sql(command, query_on_ddf)
     if not (command.lower().startswith('create') or command.lower().startswith('load')):
         return util.parse_sql_result(res)
     return res
Beispiel #2
0
 def sql(self, command, data_source='spark'):
     """
     Execute a sql command and return a list of strings
     :param command: the sql command to run
     :param data_source: data source
     """
     command = command.strip()
     res = self._jdm.sql(command, data_source)
     if not (command.lower().startswith('create') or command.lower().startswith('load')):
         return util.parse_sql_result(res)
     return res
Beispiel #3
0
 def sql(self, command, query_on_ddf=True):
     """
     Execute a sql command and return a list of strings
     :param command: the sql command to run
     :param query_on_ddf: whether the query is on ddf or on the origianl engine
     """
     command = command.strip()
     res = self._jdm.sql(command, query_on_ddf)
     if not (command.lower().startswith('create')
             or command.lower().startswith('load')):
         return util.parse_sql_result(res)
     return res
Beispiel #4
0
 def sql(self, command, data_source='spark'):
     """
     Execute a sql command and return a list of strings
     :param command: the sql command to run
     :param data_source: data source
     """
     command = command.strip()
     res = self._jdm.sql(command, data_source)
     if not (command.lower().startswith('create')
             or command.lower().startswith('load')):
         return util.parse_sql_result(res)
     return res