Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-11696

Incorrect warnings when creating text/sequence table with row format delimiters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 4.1.0, Impala 4.2.0, Impala 4.1.1
    • Impala 4.1.2, Impala 4.3.0
    • Frontend
    • None

    Description

      IMPALA-9822 adds a warning when the customized row format delimiters in the CreateTable statement is ignored. However, we see the same warning when creating TEXT or SEQUENCE_FILE tables.

      [localhost:21050] default> create external table my_csv (a int, b string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' stored as textfile;
      Query: create external table my_csv (a int, b string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' stored as textfile
      +-------------------------+
      | summary                 |
      +-------------------------+
      | Table has been created. |
      +-------------------------+
      WARNINGS: 'ROW FORMAT DELIMITED FIELDS TERMINATED BY ','' is ignored.
      Fetched 1 row(s) in 0.11s 

      The following code is buggy:

          if (getRowFormat() != null) {
            String fieldDelimiter = getRowFormat().getFieldDelimiter();
            String lineDelimiter = getRowFormat().getLineDelimiter();
            String escapeChar = getRowFormat().getEscapeChar();
            if (getFileFormat() != THdfsFileFormat.TEXT
                || getFileFormat() != THdfsFileFormat.SEQUENCE_FILE) {  // Should use && instead
              if (fieldDelimiter != null) {
                analyzer.addWarning("'ROW FORMAT DELIMITED FIELDS TERMINATED BY '"
                    + fieldDelimiter + "'' is ignored.");
              }
              if (lineDelimiter != null) {
                analyzer.addWarning("'ROW FORMAT DELIMITED LINES TERMINATED BY '"
                    + lineDelimiter + "'' is ignored.");
              }
              if (escapeChar != null) {
                analyzer.addWarning(
                    "'ROW FORMAT DELIMITED ESCAPED BY '" + escapeChar + "'' is ignored.");
              }
            }
          }
      

      https://github.com/apache/impala/blob/8271bdd587d241cd5a61ccae7422bbb5fafcfaf7/fe/src/main/java/org/apache/impala/analysis/CreateTableStmt.java#L276

      Attachments

        Issue Links

          Activity

            People

              stigahuang Quanlong Huang
              stigahuang Quanlong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: