配置单元函数 quarter() returns 'invalid function'
Hive function quarter() returns 'invalid function'
这表示函数 quarter() 是在 Hive 1.3 中引入的
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions
我正在使用默认版本的 HDInsight (3.1) 到 运行 Hadoop:
https://azure.microsoft.com/en-us/documentation/articles/hdinsight-component-versioning/
当我尝试使用 quarter 函数时,我得到:
使用文件中的配置初始化日志记录:/C:/apps/dist/hive-0.13.0.2.1.15.1-0001/conf/hive-log4j.properties
SLF4J:Class 路径包含多个 SLF4J 绑定。
SLF4J:在 [jar:file:/C:/apps/dist/hadoop-2.4.0.2.1.15.1-0001/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.[=43 中找到绑定=]]
SLF4J:在 [jar:file:/C:/apps/dist/hbase-0.98.0.2.1.15.1-0001-hadoop2/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.[=43 中发现绑定=]]
SLF4J:有关解释,请参阅 http://www.slf4j.org/codes.html#multiple_bindings。
SLF4J:实际绑定的类型为 [org.slf4j.impl.Log4jLoggerFactory]
失败:SemanticException [错误 10011]:行 10:1 无效函数 'quarter'
我错过了什么?
不幸的是,HDInsight 3.1 仅是 运行Hive 0.13.1,四分之一功能在 1.3 版之前不可用。可以看到所有的hive releasehere
下面给出了各种 HDInsight 版本中的 Hive 版本。据此,您的配置单元版本为 0.13.1,配置单元版本 1.3 支持该季度。
HDINSIGHT 版本 3.2- Hive-0.14.0
HDINSIGHT 版本 3.1- Hive-0.13.1
HDINSIGHT 版本 3.0- Hive-0.12.0
HDINSIGHT 版本 2.1- Hive-0.11.0
如果您使用的是不支持 quarter() 的旧版 Hive,请尝试以下操作:
ceil(month(date) / 3.0)
这表示函数 quarter() 是在 Hive 1.3 中引入的
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions
我正在使用默认版本的 HDInsight (3.1) 到 运行 Hadoop:
https://azure.microsoft.com/en-us/documentation/articles/hdinsight-component-versioning/
当我尝试使用 quarter 函数时,我得到:
使用文件中的配置初始化日志记录:/C:/apps/dist/hive-0.13.0.2.1.15.1-0001/conf/hive-log4j.properties SLF4J:Class 路径包含多个 SLF4J 绑定。 SLF4J:在 [jar:file:/C:/apps/dist/hadoop-2.4.0.2.1.15.1-0001/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.[=43 中找到绑定=]] SLF4J:在 [jar:file:/C:/apps/dist/hbase-0.98.0.2.1.15.1-0001-hadoop2/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.[=43 中发现绑定=]] SLF4J:有关解释,请参阅 http://www.slf4j.org/codes.html#multiple_bindings。 SLF4J:实际绑定的类型为 [org.slf4j.impl.Log4jLoggerFactory] 失败:SemanticException [错误 10011]:行 10:1 无效函数 'quarter'
我错过了什么?
不幸的是,HDInsight 3.1 仅是 运行Hive 0.13.1,四分之一功能在 1.3 版之前不可用。可以看到所有的hive releasehere
下面给出了各种 HDInsight 版本中的 Hive 版本。据此,您的配置单元版本为 0.13.1,配置单元版本 1.3 支持该季度。
HDINSIGHT 版本 3.2- Hive-0.14.0
HDINSIGHT 版本 3.1- Hive-0.13.1
HDINSIGHT 版本 3.0- Hive-0.12.0
HDINSIGHT 版本 2.1- Hive-0.11.0
如果您使用的是不支持 quarter() 的旧版 Hive,请尝试以下操作:
ceil(month(date) / 3.0)