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

CBO failed for select current_database()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.3.0
    • CBO
    • None

    Description

      When issuing the following query, with hive.cbo.enable set to true:
      select current_database();

      The following exception is printed to the Hiveserver2 logs:

      2016-06-30T09:58:24,146 ERROR [HiveServer2-Handler-Pool: Thread-33] parse.CalcitePlanner: CBO failed, skipping CBO.
      org.apache.hadoop.hive.ql.optimizer.calcite.CalciteSemanticException: Unsupported
      at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genLogicalPlan(CalcitePlanner.java:3136)
      at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:940)
      at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:894)
      at org.apache.calcite.tools.Frameworks$1.apply(Frameworks.java:113)
      at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:969)
      at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:149)
      at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:106)
      at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(CalcitePlanner.java:712)
      at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:280)
      at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10795)
      at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:239)
      at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:250)
      at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:438)
      at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:329)
      at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1159)
      at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1146)
      at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:191)
      at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:276)
      at org.apache.hive.service.cli.operation.Operation.run(Operation.java:324)
      at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:464)
      at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(HiveSessionImpl.java:451)
      at org.apache.hive.service.cli.CLIService.executeStatementAsync(CLIService.java:295)
      at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:509)
      at org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1437)
      at org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1422)
      at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
      at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
      at org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56)
      at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)

      Attachments

        1. HIVE-14138.2.patch
          4 kB
          Peter Vary
        2. HIVE-14138.patch
          3 kB
          Peter Vary

        Issue Links

          Activity

            People

              pvary Peter Vary
              pvary Peter Vary
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: