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

Spark Hive SQL returning empty dataframe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.4.6
    • None
    • Spark Core, Spark Shell
    • None

    Description

      I am trying to run a sql query on a hive table using hive connector in spark but I am getting an empty dataframe. The query I am trying to run:-

      sparkSession.sql("select fmid from farmers where fmid between ' 1000405134' and '1000772585'")

      This is failing but if I remove the leading whitespaces it works.

      sparkSession.sql("select fmid from farmers where fmid between '1000405134' and '1000772585'")

      Currently, I am removing leading and trailing whitespaces as a workaround. But the same query with whitespaces works fine in hive console.

      Attachments

        1. image-2020-11-03-13-30-12-049.png
          59 kB
          Liu Neng
        2. farmers.csv
          2.16 MB
          Debadutta

        Activity

          People

            Unassigned Unassigned
            dgodnaik Debadutta
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: