You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/30 09:19:01 UTC

[GitHub] [flink] lirui-apache commented on a change in pull request #10625: [FLINK-15259][hive] HiveInspector.toInspectors() should convert Flink…

lirui-apache commented on a change in pull request #10625: [FLINK-15259][hive] HiveInspector.toInspectors() should convert Flink…
URL: https://github.com/apache/flink/pull/10625#discussion_r361935078
 
 

 ##########
 File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/table/module/hive/HiveModuleTest.java
 ##########
 @@ -88,4 +94,24 @@ public void testHiveBuiltInFunction() {
 	public void testNonExistFunction() {
 		assertFalse(new HiveModule(HiveShimLoader.getHiveVersion()).getFunctionDefinition("nonexist").isPresent());
 	}
+
+	@Test
+	public void testConstantArguments() throws Exception {
+		TableEnvironment tEnv = HiveTestUtils.createTableEnvWithBlinkPlannerBatchMode();
+
+		tEnv.unloadModule("core");
+		tEnv.loadModule("hive", new HiveModule(HiveShimLoader.getHiveVersion()));
+
+		List<Row> results = TableUtils.collectToList(tEnv.sqlQuery("select concat('an', 'bn')"));
+		assertEquals("[anbn]", results.toString());
+
+		results = TableUtils.collectToList(tEnv.sqlQuery("select concat('ab', cast('cdefghi' as varchar(5)))"));
 
 Review comment:
   Unfortunately we cannot test `null` literals, because Hive functions consider nulls as non-constant arguments: https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/functions/hive/HiveFunction.java#L36
   
   Maybe we should consider all the passed arguments as constant, and don't pass non-constant arguments in the first place. But that'll need to change the interface.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services