SteNicholas commented on a change in pull request #12009:
URL: https://github.com/apache/flink/pull/12009#discussion_r422454850
##########
File path: flink-python/pyflink/table/tests/test_sql.py
##########
@@ -58,6 +56,40 @@ def test_sql_query(self):
expected = ['2,Hi,Hello', '3,Hello,Hello']
self.assert_equals(actual, expected)
+ def test_execute_sql(self):
+ t_env = self.t_env
+ table_result = t_env.execute_sql("create table tbl"
+ "("
+ " a bigint,"
+ " b int,"
+ " c varchar"
+ ") with ("
+ " 'connector' = 'COLLECTION',"
+ " 'is-bounded' = 'false'"
+ ")")
+ self.assertIsNone(table_result.get_job_client())
+ self.assertIsNotNone(table_result.get_table_schema())
+ self.assertEqual(table_result.get_table_schema().get_field_count(), 1)
+ self.assertIsNotNone(table_result.get_result_kind())
+ self.assertEqual(table_result.get_result_kind(), ResultKind.SUCCESS)
+ table_result.print()
+
+ table_result = t_env.execute_sql("alter table tbl set ('k1' = 'a',
'k2' = 'b')")
+ self.assertIsNone(table_result.get_job_client())
+ self.assertIsNotNone(table_result.get_table_schema())
+ self.assertEqual(table_result.get_table_schema().get_field_count(), 1)
+ self.assertIsNotNone(table_result.get_result_kind())
+ self.assertEqual(table_result.get_result_kind(), ResultKind.SUCCESS)
+ table_result.print()
+
+ table_result = t_env.execute_sql("drop table tbl")
+ self.assertIsNone(table_result.get_job_client())
Review comment:
I prefer the point that merge this PR after FLINK-16367. getJobClient()
has been implemented in this task and it seems the PR will be merged soon.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]