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
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