def test_get_hplsql_statements(): # Not spliting statements at semicolon assert_equal( "CREATE FUNCTION hello()\n RETURNS STRING\nBEGIN\n RETURN 'Hello, world';\nEND", split_statements( "CREATE FUNCTION hello()\n RETURNS STRING\nBEGIN\n RETURN 'Hello, world';\nEND", 'hplsql')[0][2]) assert_not_equal( "CREATE FUNCTION hello()\n RETURNS STRING\nBEGIN\n RETURN 'Hello, world';\nEND", split_statements( "CREATE FUNCTION hello()\n RETURNS STRING\nBEGIN\n RETURN 'Hello, world';\nEND" )[0][2])
def statements(self): hql_query = strip_trailing_semicolon(self.hql_query) return [ strip_trailing_semicolon(statement) for (start_row, start_col), ( end_row, end_col), statement in split_statements(hql_query) ]
def statements(self): hql_query = strip_trailing_semicolon(self.hql_query) dialect = 'hplsql' if self._data_dict['query']['type'] == 4 else None return [ strip_trailing_semicolon(statement) for (start_row, start_col), ( end_row, end_col), statement in split_statements(hql_query, dialect) ]
def statements(self): hql_query = strip_trailing_semicolon(self.hql_query) return [strip_trailing_semicolon(statement) for (start_row, start_col), (end_row, end_col), statement in split_statements(hql_query)]