Uploaded image for project: 'Eagle (Retired)'
  1. Eagle (Retired)
  2. EAGLE-333

Hive ql.Parser can't parse complex query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • v0.3.0, v0.4.0
    • v0.4.0
    • None
    • None

    Description

      For example, parse following query:

       SELECT count(distinct id) FROM db.table1
      

      will throw NullPointerException:

      java.lang.NullPointerException
      at org.apache.eagle.security.hive.ql.Parser.addToColumnSet(Parser.java:356)
      at org.apache.eagle.security.hive.ql.Parser.parseSelectExpr(Parser.java:285)
      at org.apache.eagle.security.hive.ql.Parser.parseSelectExpr(Parser.java:327)
      at org.apache.eagle.security.hive.ql.Parser.parseSelectClause(Parser.java:277)
      at org.apache.eagle.security.hive.ql.Parser.parseInsertClause(Parser.java:218)
      at org.apache.eagle.security.hive.ql.Parser.parseQueryClause(Parser.java:194)
      at org.apache.eagle.security.hive.ql.Parser.parseQL(Parser.java:117)
      at org.apache.eagle.security.hive.ql.Parser.run(Parser.java:81)
      at org.apache.eagle.security.hive.ql.TestParser._testParsingQuery(TestParser.java:44)
      at org.apache.eagle.security.hive.ql.TestParser.testCountDistinct(TestParser.java:245)

      The root cause is ASTNode is TOK_FUNCTIONDI type at this time, so use parseTokFunction() to parse it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yumwang Yuming Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: