Skip to content

Conversation

@cloud-fan
Copy link
Contributor

@cloud-fan cloud-fan commented Aug 28, 2019

What changes were proposed in this pull request?

There are 2 in-memory TableCatalog and Table implementations for testing, in sql/catalyst and sql/core. This PR merges them.

After merging, there are 3 classes:

  1. InMemoryTable
  2. InMemoryTableCatalog
  3. StagingInMemoryTableCatalog

For better maintainability, these 3 classes are put in 3 different files.

Why are the changes needed?

reduce duplicated code

Does this PR introduce any user-facing change?

no

How was this patch tested?

N/A

if (tables.containsKey(ident)) {
throw new TableAlreadyExistsException(ident)
}

if (partitions.nonEmpty) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the sql/core version supports partitions, so the merged version should support partitions as well.

import org.apache.spark.sql.util.CaseInsensitiveStringMap

// this is currently in the spark-sql module because the read and write API is not in catalyst
// TODO(rdblue): when the v2 source API is in catalyst, merge with TestTableCatalog/InMemoryTable
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This TODO is completed in this PR.

@cloud-fan
Copy link
Contributor Author

cc @rdblue @brkyvz

@SparkQA
Copy link

SparkQA commented Aug 28, 2019

Test build #109868 has finished for PR 25610 at commit 4fa9303.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class InMemoryTable(
  • class InMemoryBatchScan(data: Array[InputPartition]) extends Scan with Batch
  • class BufferedRows extends WriterCommitMessage with InputPartition with Serializable
  • class InMemoryTableCatalog extends TableCatalog with SupportsNamespaces
  • class StagingInMemoryTableCatalog extends InMemoryTableCatalog with StagingTableCatalog

@SparkQA
Copy link

SparkQA commented Aug 28, 2019

Test build #109869 has finished for PR 25610 at commit 95b8bb9.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Aug 28, 2019

Test build #109870 has finished for PR 25610 at commit 317cff1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class InMemoryTable(
  • class InMemoryBatchScan(data: Array[InputPartition]) extends Scan with Batch
  • class BufferedRows extends WriterCommitMessage with InputPartition with Serializable
  • class InMemoryTableCatalog extends TableCatalog with SupportsNamespaces
  • class StagingInMemoryTableCatalog extends InMemoryTableCatalog with StagingTableCatalog

@SparkQA
Copy link

SparkQA commented Aug 29, 2019

Test build #109894 has finished for PR 25610 at commit a0bd8da.

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

@rdblue
Copy link
Contributor

rdblue commented Aug 29, 2019

+1

@rdblue rdblue closed this in f8f7c52 Aug 29, 2019
@rdblue
Copy link
Contributor

rdblue commented Aug 29, 2019

Merged to master.

@dongjoon-hyun
Copy link
Member

Yey! Congratulation, @rdblue !!! 😄

@rdblue
Copy link
Contributor

rdblue commented Aug 29, 2019

Thanks!

@cloud-fan
Copy link
Contributor Author

@rdblue congrats and thanks for merging my PR! Hopefully this is your first Spark PR merging :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants