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

Executing INSERT OVERWRITE from JDBC Inserts Zero Records

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • Impala 1.2.3
    • Impala 1.3
    • None
    • None
    • impalad version 1.2.3 RELEASE (build 1cab04cdb88968a963a8ad6121a2e72a3a623eca)
      CentOS release 6.5 (kernel 2.6.32-431.3.1.el6.x86_64)
      Java 1.7.0_21-b11

    Description

      While using JDBC, I have observed that creating and populating a table based on another table results in a new table that contains zero records. Issuing the same SQL statements through impala-shell populates the target table as expected.

      Here is the overview of what I found:

      0. I open a connection to Impala via JDBC for the subsequent steps

      1. I create a new table (prospects) using tab-delimited text format

      2. I populate the prospects table with 5000 records.

      3. Using a CREATE TABLE .. AS SELECT or a CREATE TABLE .. LIKE (the latter being followed by INSERT INTO or INSERT OVERWRITE), I attempt to populate the new table using data from original table. There is no visible exception, so I am led to believe that it worked OK.

      4. I issue a SELECT statement (with no WHERE or LIMIT clause) against the new table, but no records are returned.

      5. I switch to impala-shell and issue the exact same INSERT OVERWRITE statement from step 2. It reports that 5000 rows were inserted.

      6. Using JDBC again, I issue the exact same SELECT statement from step 4 and it returns all the records I expected.

      I have attached two classes that demonstrate the problem (TableDataGenerator just populates the table; CreateAndQueryTableClient is the one you should run). Although I used parquet format for the target table, I can reproduce the problem with a target table in text file format.

      Attachments

        1. TableDataGenerator.java
          6 kB
          Tom Wheeler
        2. impala-shell-session-for-IMPALA-813.txt
          2 kB
          Tom Wheeler
        3. CreateAndQueryTableClient.java
          3 kB
          Tom Wheeler

        Activity

          People

            alan@cloudera.com Alan Choi
            twheeler@cloudera.com_impala_982d Tom Wheeler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: