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

Hive should not split semicolon within quoted string literals

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: None
    • Labels:
      None

      Description

      String literals in query cannot have reserved symbols. The same set of query works fine in mysql and postgresql.

      hive> CREATE TABLE ts(s varchar(550));
      OK
      Time taken: 0.075 seconds
      hive> INSERT INTO ts VALUES ('Mozilla/5.0 (iPhone; CPU iPhone OS 5_0');
      MismatchedTokenException(14!=326)
      	at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
      	at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.valueRowConstructor(HiveParser_FromClauseParser.java:7271)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.valuesTableConstructor(HiveParser_FromClauseParser.java:7370)
      	at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.valuesClause(HiveParser_FromClauseParser.java:7510)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.valuesClause(HiveParser.java:51854)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.regularBody(HiveParser.java:45432)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpressionBody(HiveParser.java:44578)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:44448)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1694)
      	at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1176)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:204)
      	at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:402)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:326)
      	at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1169)
      	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1288)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1095)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1083)
      	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:232)
      	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:183)
      	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:399)
      	at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:776)
      	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:714)
      	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641)
      	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.apache.hadoop.util.RunJar.run(RunJar.java:221)
      	at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
      FAILED: ParseException line 1:31 mismatched input '/' expecting ) near 'Mozilla' in value row constructor
      hive>
      

        Attachments

        1. HIVE-15297.05.patch
          5.04 MB
          Pengcheng Xiong
        2. HIVE-15297.04.patch
          3.66 MB
          Pengcheng Xiong
        3. HIVE-15297.03.patch
          14 kB
          Pengcheng Xiong
        4. HIVE-15297.02.patch
          13 kB
          Pengcheng Xiong
        5. HIVE-15297.01.patch
          11 kB
          Pengcheng Xiong

          Issue Links

            Activity

              People

              • Assignee:
                pxiong Pengcheng Xiong
                Reporter:
                pxiong Pengcheng Xiong
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: