flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] bowenli86 commented on a change in pull request #9988: [FLINK-14418][hive] Create HiveModule to provide Hive built-in functions
Date Tue, 29 Oct 2019 20:45:59 GMT
bowenli86 commented on a change in pull request #9988: [FLINK-14418][hive] Create HiveModule
to provide Hive built-in functions
URL: https://github.com/apache/flink/pull/9988#discussion_r340315950
 
 

 ##########
 File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/factories/HiveFunctionDefinitionFactory.java
 ##########
 @@ -67,14 +69,26 @@ public HiveFunctionDefinitionFactory(HiveConf hiveConf) {
 		this.hiveShim = HiveShimLoader.loadHiveShim(hiveVersion);
 	}
 
+	public HiveFunctionDefinitionFactory(String hiveVersion) {
+		checkArgument(!StringUtils.isNullOrWhitespaceOnly(hiveVersion),
+			"Hive version cannot be null or empty string");
+		this.hiveVersion = hiveVersion;
+		this.hiveShim = HiveShimLoader.loadHiveShim(hiveVersion);
+	}
+
 	@Override
 	public FunctionDefinition createFunctionDefinition(String name, CatalogFunction catalogFunction)
{
 		if (Boolean.valueOf(catalogFunction.getProperties().get(CatalogConfig.IS_GENERIC))) {
 			FunctionDefinitionUtil.createFunctionDefinition(name, catalogFunction);
 		}
 
-		String functionClassName = catalogFunction.getClassName();
+		return createFunctionDefinitionFromHiveFunction(name, catalogFunction.getClassName());
+	}
 
+	/**
+	 * Create a FunctionDefinition from a Hive function's class name.
+	 */
+	public FunctionDefinition createFunctionDefinitionFromHiveFunction(String name, String functionClassName)
{
 
 Review comment:
   it's used in HiveModule

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

Mime
View raw message