You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Nicholas Chammas (JIRA)" <ji...@apache.org> on 2016/05/10 16:28:13 UTC
[jira] [Comment Edited] (SPARK-15193) samplingRatio should default
to 1.0 across the board
[ https://issues.apache.org/jira/browse/SPARK-15193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15278393#comment-15278393 ]
Nicholas Chammas edited comment on SPARK-15193 at 5/10/16 4:27 PM:
-------------------------------------------------------------------
Nope, a sampling ratio of 1.0 and None mean [different things|http://spark.apache.org/docs/1.6.1/api/python/pyspark.sql.html#pyspark.sql.SQLContext.createDataFrame]:
{quote}
If schema inference is needed, samplingRatio is used to determined the ratio of rows used for schema inference. The first row will be used if samplingRatio is None.
{quote}
createDataFrame() is not consistent with jsonRDD() as of 1.6.1.
Looking in master, I can't seem to find jsonRDD() for Python anymore, so perhaps that got removed. So actually you're right, it looks like the default _did_ get standardized, but to None. :/
was (Author: nchammas):
Nope, a sampling ratio of 1.0 and None mean [different things|http://spark.apache.org/docs/1.6.1/api/python/pyspark.sql.html#pyspark.sql.SQLContext.createDataFrame]:
{quote}
If schema inference is needed, samplingRatio is used to determined the ratio of rows used for schema inference. The first row will be used if samplingRatio is None.
{quote}
createDataFrame() is not consistent with jsonRDD() as of 1.6.1.
Looking in master, I can't seem to find jsonRDD() for Python anymore, so perhaps that got removed. So actually, it looks like the default _did_ get standardized, but to None. :/
> samplingRatio should default to 1.0 across the board
> ----------------------------------------------------
>
> Key: SPARK-15193
> URL: https://issues.apache.org/jira/browse/SPARK-15193
> Project: Spark
> Issue Type: Improvement
> Components: PySpark, SQL
> Reporter: Nicholas Chammas
> Priority: Minor
>
> The default sampling ratio for {{jsonRDD}} is [1.0|http://spark.apache.org/docs/1.6.1/api/python/pyspark.sql.html#pyspark.sql.SQLContext.jsonRDD], whereas for {{createDataFrame}} it's [{{None}}|http://spark.apache.org/docs/1.6.1/api/python/pyspark.sql.html#pyspark.sql.SQLContext.createDataFrame].
> I think the default sampling ratio should be 1.0 across the board. Users should have to explicitly supply a lower sampling ratio if they know their dataset has a consistent structure. Otherwise, I think the "safer" thing to default to is to check all the data.
> Targeting this for 2.0 in case we consider it a breaking change that would be more difficult to get in later.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org