Skip to content

[SPARK-21929][SQL] Support ALTER TABLE table_name ADD COLUMNS(..) for ORC data source#19545

Closed
dongjoon-hyun wants to merge 2 commits intoapache:masterfrom
dongjoon-hyun:SPARK-21929
Closed

[SPARK-21929][SQL] Support ALTER TABLE table_name ADD COLUMNS(..) for ORC data source#19545
dongjoon-hyun wants to merge 2 commits intoapache:masterfrom
dongjoon-hyun:SPARK-21929

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Oct 20, 2017

What changes were proposed in this pull request?

When SPARK-19261 implements ALTER TABLE ADD COLUMNS, ORC data source is omitted due to SPARK-14387, SPARK-16628, and SPARK-18355. Now, those issues are fixed and Spark 2.3 is using Spark schema to read ORC table instead of ORC file schema. This PR enables ALTER TABLE ADD COLUMNS for ORC data source.

How was this patch tested?

Pass the updated and added test cases.

@SparkQA
Copy link

SparkQA commented Oct 21, 2017

Test build #82939 has finished for PR 19545 at commit cc52547.

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

// Hive type is already considered as hive serde table, so the logic will not
// come in here.
case _: JsonFileFormat | _: CSVFileFormat | _: ParquetFileFormat =>
case s if s.getClass.getCanonicalName.endsWith("OrcFileFormat") =>
Copy link
Member Author

Choose a reason for hiding this comment

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

After implementing OrcFileFormat based on Apache ORC, we can move OrcFileFormat from sql/hive module into sql/core module.

@dongjoon-hyun
Copy link
Member Author

Hi, @gatorsmile . Could you review this PR?

}
}

def testAddColumnPartitioned(provider: String): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: protected

}
}

def testAddColumn(provider: String): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: protected

@gatorsmile
Copy link
Member

LGTM

@dongjoon-hyun
Copy link
Member Author

Thank you for review, @gatorsmile ! I updated the PR.

@SparkQA
Copy link

SparkQA commented Oct 21, 2017

Test build #82942 has finished for PR 19545 at commit dfc59fc.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member Author

Retest this please.

@SparkQA
Copy link

SparkQA commented Oct 21, 2017

Test build #82949 has finished for PR 19545 at commit dfc59fc.

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

@dongjoon-hyun
Copy link
Member Author

It’s ready for review again, @gatorsmile. Thanks.

@gatorsmile
Copy link
Member

Thanks! Merged to master.

@asfgit asfgit closed this in ca2a780 Oct 22, 2017
@dongjoon-hyun
Copy link
Member Author

Thank you a lot, @gatorsmile !

@dongjoon-hyun dongjoon-hyun deleted the SPARK-21929 branch October 22, 2017 01:36
Sign up for free to 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.

3 participants