Skip to content

[MINOR][SQL] Add missing functions for some options in SQLConf and use them where applicable - #14678

Closed
HyukjinKwon wants to merge 4 commits into
apache:masterfrom
HyukjinKwon:sqlconf-cleanup
Closed

[MINOR][SQL] Add missing functions for some options in SQLConf and use them where applicable#14678
HyukjinKwon wants to merge 4 commits into
apache:masterfrom
HyukjinKwon:sqlconf-cleanup

Conversation

@HyukjinKwon

@HyukjinKwonHyukjinKwon commented Aug 17, 2016

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

I first thought they are missing because they are kind of hidden options but it seems they are just missing.

For example, spark.sql.parquet.mergeSchema is documented in sql-programming-guide.md but this function is missing whereas many options such as spark.sql.join.preferSortMergeJoin are not documented but have its own function individually.

So, this PR suggests making them consistent by adding the missing functions for some options in SQLConf and use them where applicable, in order to make them more readable.

How was this patch tested?

Existing tests should cover this.

@SparkQA

Copy link
Copy Markdown

Test build #63898 has finished for PR 14678 at commit c959f3b.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

.intConf
.createWithDefault(4000)

val PARTITION_DISCOVERY_ENABLED = SQLConfigBuilder("spark.sql.sources.partitionDiscovery.enabled")

@HyukjinKwonHyukjinKwonAug 17, 2016

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we always enable this and this option is not referenced anywhere(?). Is this intendedly not used?

@HyukjinKwonHyukjinKwonAug 17, 2016

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the usage was removed while refactoring.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do me a favor to check which PR removed the usage?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds like we still keep another SQLConf PARALLEL_PARTITION_DISCOVERY_THRESHOLD. However, the description of PARALLEL_PARTITION_DISCOVERY_THRESHOLD is not right after the refactoring. Could you update the descriptions too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #11509 removes the usage of PARTITION_DISCOVERY_ENABLED. I think it is safe to remove this conf now.

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

cc @rxin, Could you check if this make sense please?

@rxin

rxin commented Aug 17, 2016

Copy link
Copy Markdown
Contributor

Looks good, but I didn't look super carefully.

@gatorsmile do you have time to take a more careful look at this?

@SparkQA

Copy link
Copy Markdown

Test build #63899 has finished for PR 14678 at commit a57dd5e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile

Copy link
Copy Markdown
Member

Sure, will review it today. Thanks!

@gatorsmile

Copy link
Copy Markdown
Member

Just searched the code and found more. Any reason why we do not change these?

ParquetFileFormat.scala:85: if (conf.get(SQLConf.PARQUET_OUTPUT_COMMITTER_CLASS.key) == null) {
ParquetSchemaConverter.scala:66: assumeBinaryIsString = conf.get(
ParquetSchemaConverter.scala:67: assumeInt96IsTimestamp = conf.get(
ParquetSchemaConverter.scala:68: writeLegacyParquetFormat = conf.get(
ParquetWriteSupport.scala:80: assert(configuration.get(SQLConf.PARQUET_WRITE_LEGACY_FORMAT.key) != ParquetWriteSupport.scala:81: configuration.get(SQLConf.PARQUET_WRITE_LEGACY_FORMAT.key).toBoolean

@gatorsmile

Copy link
Copy Markdown
Member

nvm, I got the answer. We are unable to change them. Thanks!

@gatorsmile

Copy link
Copy Markdown
Member

I checked the conf changes and the data types. It looks good to me. Only leave a minor comment on the conf description of one related parameter PARALLEL_PARTITION_DISCOVERY_THRESHOLD. Thanks!

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

@gatorsmile Thanks for a very close look. I should've check the description of PARALLEL_PARTITION_DISCOVERY_THRESHOLD.

@gatorsmile

Copy link
Copy Markdown
Member

LGTM pending tests

@SparkQA

Copy link
Copy Markdown

Test build #63959 has finished for PR 14678 at commit a26c08e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

(@rxin cc you in case you just missed this)

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

ping @rxin

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

@cloud-fan Do you mind if I ask to take a look please?

@cloud-fan

Copy link
Copy Markdown
Contributor

retest this please

@cloud-fan

Copy link
Copy Markdown
Contributor

LGTM

@SparkQA

Copy link
Copy Markdown

Test build #65263 has finished for PR 14678 at commit a26c08e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan

Copy link
Copy Markdown
Contributor

thanks, merging to master!

@rxin

rxin commented Sep 16, 2016

Copy link
Copy Markdown
Contributor

Thanks but also FYI this is not "minor". We should have a JIRA ticket for changes like this in the future.

wgtmac pushed a commit to wgtmac/spark that referenced this pull request Sep 19, 2016
…e them where applicable
## What changes were proposed in this pull request?
I first thought they are missing because they are kind of hidden options but it seems they are just missing.
For example, `spark.sql.parquet.mergeSchema` is documented in [sql-programming-guide.md](https://github.com/apache/spark/blob/master/docs/sql-programming-guide.md) but this function is missing whereas many options such as `spark.sql.join.preferSortMergeJoin` are not documented but have its own function individually.
So, this PR suggests making them consistent by adding the missing functions for some options in `SQLConf` and use them where applicable, in order to make them more readable.
## How was this patch tested?
Existing tests should cover this.
Author: hyukjinkwon <gurwls223@gmail.com>
Closesapache#14678 from HyukjinKwon/sqlconf-cleanup.
@HyukjinKwon
HyukjinKwon deleted the sqlconf-cleanup branch January 2, 2018 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@HyukjinKwon@SparkQA@rxin@gatorsmile@cloud-fan