Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-18595

UNIX_TIMESTAMP UDF fails when type is Timestamp with local timezone

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • Hive
    • None

    Description

      
      2018-01-31T12:59:45,464 ERROR [10e97c86-7f90-406b-a8fa-38be5d3529cc main] ql.Driver: FAILED: SemanticException [Error 10014]: Line 3:456 Wrong arguments ''yyyy-MM-dd HH:mm:ss'': The function UNIX_TIMESTAMP takes only string/date/timestamp types
      org.apache.hadoop.hive.ql.parse.SemanticException: Line 3:456 Wrong arguments ''yyyy-MM-dd HH:mm:ss'': The function UNIX_TIMESTAMP takes only string/date/timestamp types
       at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:1394)
       at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:90)
       at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatchAndReturn(DefaultGraphWalker.java:105)
       at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:89)
       at org.apache.hadoop.hive.ql.lib.ExpressionWalker.walk(ExpressionWalker.java:76)
       at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:120)
       at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(TypeCheckProcFactory.java:235)
       at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(TypeCheckProcFactory.java:181)
       at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genAllExprNodeDesc(SemanticAnalyzer.java:11847)
       at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genAllExprNodeDesc(SemanticAnalyzer.java:11780)
       at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genGBLogicalPlan(CalcitePlanner.java:3140)
       at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genLogicalPlan(CalcitePlanner.java:4330)
       at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1407)
       at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1354)
       at org.apache.calcite.tools.Frameworks$1.apply(Frameworks.java:118)
       at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:1052)
       at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:154)
       at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:111)
       at org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1159)
       at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(CalcitePlanner.java:1175)
       at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:422)
       at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:11393)
       at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:304)
       at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:268)
       at org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(ExplainSemanticAnalyzer.java:163)
       at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:268)
       at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:639)
       at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1504)
       at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1632)
       at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1395)
       at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1382)
       at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:240)
       at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:188)
       at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410)
       at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:343)
       at org.apache.hadoop.hive.ql.QTestUtil.executeClientInternal(QTestUtil.java:1331)
       at org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:1305)
       at org.apache.hadoop.hive.cli.control.CoreCliDriver.runTest(CoreCliDriver.java:173)
       at org.apache.hadoop.hive.cli.control.CliAdapter.runTest(CliAdapter.java:104)
       at org.apache.hadoop.hive.cli.TestMiniDruidCliDriver.testCliDriver(TestMiniDruidCliDriver.java:59)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
       at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
       at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
       at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
       at org.apache.hadoop.hive.cli.control.CliAdapter$2$1.evaluate(CliAdapter.java:92)
       at org.junit.rules.RunRules.evaluate(RunRules.java:20)
       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
       at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
       at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
       at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
       at org.junit.runners.Suite.runChild(Suite.java:127)
       at org.junit.runners.Suite.runChild(Suite.java:26)
       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
       at org.apache.hadoop.hive.cli.control.CliAdapter$1$1.evaluate(CliAdapter.java:73)
       at org.junit.rules.RunRules.evaluate(RunRules.java:20)
       at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
       at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:369)
       at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:275)
       at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:239)
       at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:160)
       at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:373)
       at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:334)
       at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:119)
       at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:407)
      Caused by: org.apache.hadoop.hive.ql.exec.UDFArgumentException: The function UNIX_TIMESTAMP takes only string/date/timestamp types
       at org.apache.hadoop.hive.ql.udf.generic.GenericUDFToUnixTimeStamp.initializeInput(GenericUDFToUnixTimeStamp.java:110)
       at org.apache.hadoop.hive.ql.udf.generic.GenericUDFUnixTimeStamp.initializeInput(GenericUDFUnixTimeStamp.java:43)
       at org.apache.hadoop.hive.ql.udf.generic.GenericUDFToUnixTimeStamp.initialize(GenericUDFToUnixTimeStamp.java:67)
       at org.apache.hadoop.hive.ql.udf.generic.GenericUDF.initializeAndFoldConstants(GenericUDF.java:147)
       at org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc.newInstance(ExprNodeGenericFuncDesc.java:259)
       at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.getXpathOrFuncExprNodeDesc(TypeCheckProcFactory.java:1132)
       at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:1386)
       ... 76 more
      
       
      
      

      Attachments

        1. HIVE-18595.patch
          9 kB
          Slim Bouguerra
        2. HIVE-18595.patch
          9 kB
          Slim Bouguerra
        3. HIVE-18595.3.patch
          9 kB
          Slim Bouguerra

        Issue Links

          Activity

            People

              bslim Slim Bouguerra
              bslim Slim Bouguerra
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: