Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2408

CTAS should not create empty folders when underlying query returns no results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.8.0
    • 1.0.0
    • Storage - Writer
    • None

    Description

      0: jdbc:drill:schema=dfs> select c_integer, c_bigint, c_date, c_time, c_varchar from j4 where c_bigint is null;
      +------------+------------+------------+------------+------------+
      | c_integer  |  c_bigint  |   c_date   |   c_time   | c_varchar  |
      +------------+------------+------------+------------+------------+
      +------------+------------+------------+------------+------------+
      No rows selected (0.126 seconds)
      0: jdbc:drill:schema=dfs> create table ctas_t6(c1,c2,c3,c4,c5) as select c_integer, c_bigint, c_date, c_time, c_varchar from j4 where c_bigint is null;
      +------------+---------------------------+
      |  Fragment  | Number of records written |
      +------------+---------------------------+
      | 0_0        | 0                         |
      +------------+---------------------------+
      1 row selected (0.214 seconds)
      0: jdbc:drill:schema=dfs> select * from ctas_t6;
      Query failed: IndexOutOfBoundsException: Index: 0, Size: 0
      
      Error: exception while executing query: Failure while executing query. (state=,code=0)
      

      parquet file was not created, but directory was:

      [Mon Apr 06 09:03:41 root@/mapr/vmarkman.cluster.com/drill/testdata/joins/ctas_t6 ] # pwd
      /mapr/vmarkman.cluster.com/drill/testdata/joins/ctas_t6
      [Mon Apr 06 09:03:45 root@/mapr/vmarkman.cluster.com/drill/testdata/joins/ctas_t6 ] # ls -l
      total 0
      

      Attachments

        1. DRILL-2408.8.patch.txt
          19 kB
          Abdel Hakim Deneche
        2. DRILL-2408.7.patch.txt
          19 kB
          Abdel Hakim Deneche
        3. DRILL-2408.6.patch.txt
          16 kB
          Abdel Hakim Deneche
        4. DRILL-2408.5.patch.txt
          16 kB
          Abdel Hakim Deneche
        5. DRILL-2408.4.patch.txt
          7 kB
          Abdel Hakim Deneche
        6. DRILL-2408.3.patch.txt
          14 kB
          Abdel Hakim Deneche
        7. DRILL-2408.2.patch.txt
          15 kB
          Abdel Hakim Deneche
        8. DRILL-2408.1.patch.txt
          15 kB
          Abdel Hakim Deneche

        Issue Links

          Activity

            People

              amansinha100 Aman Sinha
              amansinha100 Aman Sinha
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: