-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-5182] [SPARK-5528] [SPARK-5509] [SPARK-3575] [SQL] Parquet data source improvements #4308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5654c9d
Draft version of Parquet partition discovery and schema merging
liancheng a1896c7
Fixes all existing Parquet test suites except for ParquetMetastoreSuite
liancheng 7d0f7a2
Fixes Metastore Parquet table conversion
liancheng 596c312
Uses switch to control whether use Parquet data source or not
liancheng dd704fd
Fixes Python Parquet API
liancheng b35c8c6
Fixes some typos and outdated comments
liancheng 0d8ec1d
Adds more test cases
liancheng 4e0175f
Fixes Python Parquet API, we need Py4J array to call varargs method
liancheng adf2aae
Fixes compilation error introduced while rebasing
liancheng 50dd8d1
Addresses @rxin's comment, fixes UDT schema merging
liancheng 808380f
Fixes issues introduced while rebasing
liancheng a49bd28
Fixes spelling typo in trait name "CreateableRelationProvider"
liancheng 8232e17
Write support for Parquet data source
liancheng b6946e6
Fixes MiMA issues, addresses comments
liancheng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,14 +20,13 @@ package org.apache.spark.sql | |
| import java.beans.Introspector | ||
| import java.util.Properties | ||
|
|
||
| import scala.collection.immutable | ||
| import scala.collection.JavaConversions._ | ||
| import scala.collection.immutable | ||
| import scala.language.implicitConversions | ||
| import scala.reflect.runtime.universe.TypeTag | ||
|
|
||
| import org.apache.spark.{SparkContext, Partition} | ||
| import org.apache.spark.annotation.{AlphaComponent, DeveloperApi, Experimental} | ||
| import org.apache.spark.api.java.{JavaSparkContext, JavaRDD} | ||
| import org.apache.spark.api.java.{JavaRDD, JavaSparkContext} | ||
| import org.apache.spark.rdd.RDD | ||
| import org.apache.spark.sql.catalyst.ScalaReflection | ||
| import org.apache.spark.sql.catalyst.analysis._ | ||
|
|
@@ -36,11 +35,12 @@ import org.apache.spark.sql.catalyst.optimizer.{DefaultOptimizer, Optimizer} | |
| import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan} | ||
| import org.apache.spark.sql.catalyst.rules.RuleExecutor | ||
| import org.apache.spark.sql.execution._ | ||
| import org.apache.spark.sql.json._ | ||
| import org.apache.spark.sql.jdbc.{JDBCPartition, JDBCPartitioningInfo, JDBCRelation} | ||
| import org.apache.spark.sql.sources._ | ||
| import org.apache.spark.sql.json._ | ||
| import org.apache.spark.sql.sources.{BaseRelation, DDLParser, DataSourceStrategy, LogicalRelation, _} | ||
| import org.apache.spark.sql.types._ | ||
| import org.apache.spark.util.Utils | ||
| import org.apache.spark.{Partition, SparkContext} | ||
|
|
||
| /** | ||
| * :: AlphaComponent :: | ||
|
|
@@ -303,8 +303,14 @@ class SQLContext(@transient val sparkContext: SparkContext) | |
| * | ||
| * @group userf | ||
| */ | ||
| def parquetFile(path: String): DataFrame = | ||
| DataFrame(this, parquet.ParquetRelation(path, Some(sparkContext.hadoopConfiguration), this)) | ||
| @scala.annotation.varargs | ||
| def parquetFile(path: String, paths: String*): DataFrame = | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not just
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is per @rxin's this comment, which I think makes sense. |
||
| if (conf.parquetUseDataSourceApi) { | ||
| baseRelationToDataFrame(parquet.ParquetRelation2(path +: paths, Map.empty)(this)) | ||
| } else { | ||
| DataFrame(this, parquet.ParquetRelation( | ||
| paths.mkString(","), Some(sparkContext.hadoopConfiguration), this)) | ||
| } | ||
|
|
||
| /** | ||
| * Loads a JSON file (one object per line), returning the result as a [[DataFrame]]. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes SPARK-5509. Hit this bug while testing Parquet filters for new data source implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw this is really expensive. i'd use sth like this: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/primitives/UnsignedBytes.html
If you don't want to change it as part of this PR, file a jira ticket to track it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed SPARK-5553 to track this. I'd like to make sure equality comparison for binary types works properly in this PR. Also, we're already using
Orderingto compare binary values inLessThanandGreaterThanetc., so at least this isn't a performance regression.