spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suchintak Patnaik (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (SPARK-29621) Querying internal corrupt record column should not be allowed in filter operation
Date Wed, 30 Oct 2019 03:39:00 GMT

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

Suchintak Patnaik edited comment on SPARK-29621 at 10/30/19 3:38 AM:
---------------------------------------------------------------------

[~hyukjin.kwon]As per this,
As per *https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala#L119-L126)*,
 it should not allow referencing only internal corrupt column right??

Then how come df.filter(df._corrupt_record.isNotNull()).count() shows error and df.filter(df._corrupt_record.isNotNull()).show()
doesn't??


was (Author: patnaik):
[~gurwls223] it should not allow referencing only internal corrupt record right??

Then how come filter.count() shows error and filter.show() doesn't??

> Querying internal corrupt record column should not be allowed in filter operation
> ---------------------------------------------------------------------------------
>
>                 Key: SPARK-29621
>                 URL: https://issues.apache.org/jira/browse/SPARK-29621
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 2.3.0
>            Reporter: Suchintak Patnaik
>            Priority: Major
>              Labels: PySpark, SparkSQL
>
> As per *https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala#L119-L126)*,
> _"Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the referenced
columns only include the internal corrupt record column"_
> But it's allowing while querying only the internal corrupt record column in case of *filter*
operation.
> {code}
> from pyspark.sql.types import *
> schema = StructType([
>     StructField("_corrupt_record", StringType(), False),
>     StructField("Name", StringType(), False),
>     StructField("Colour", StringType(), True),
>     StructField("Price", IntegerType(), True),
>     StructField("Quantity", IntegerType(), True)])
> df = spark.read.csv("fruit.csv", schema=schema, mode="PERMISSIVE")
> df.filter(df._corrupt_record.isNotNull()).show()  # Allowed
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message