[ 
https://issues.apache.org/jira/browse/SPARK-33317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17224896#comment-17224896
 ] 

Dongjoon Hyun commented on SPARK-33317:
---------------------------------------

In Apache Spark 2.4.7, the following is the result for me. Could you provide 
your procedure?

{code}
scala> spark.version
res0: String = 2.4.7

scala> spark.read.option("header", 
true).csv("/tmp/csv/farmers.csv").createOrReplaceTempView("farmers")

scala> sql("select fmid from farmers where fmid between ' 1000405134' and 
'1000772585' limit 3").show
+----------+
|      fmid|
+----------+
|1000405134|
|1000159765|
|1000489848|
+----------+
{code}

> Spark Hive SQL returning empty dataframe
> ----------------------------------------
>
>                 Key: SPARK-33317
>                 URL: https://issues.apache.org/jira/browse/SPARK-33317
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core, Spark Shell
>    Affects Versions: 2.4.6
>            Reporter: Debadutta
>            Priority: Blocker
>         Attachments: farmers.csv
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to