Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22384

Refine partition pruning when attribute is wrapped in Cast

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.4.0
    • Component/s: SQL
    • Labels:
      None

      Description

      Sql below will get all partitions from metastore, which put much burden on metastore;
      CREATE TABLE test (value INT) PARTITIONED BY (dt STRING)
      SELECT * from test where dt=2017

      The reason is that the the analyzed attribute dt is wrapped in Cast and HiveShim fails to generate a proper partition filter.

      Could we fix this? Sql like SELECT * from test where dt=2017 is common in my warehouse.

        Attachments

          Activity

            People

            • Assignee:
              jinxing6042@126.com Jin Xing
              Reporter:
              jinxing6042@126.com Jin Xing
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: