Skip to content
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

[SPARK-23158] [SQL] Move HadoopFsRelationTest test suites to from sql/hive to sql/core #20331

Closed
wants to merge 3 commits into from

Conversation

gatorsmile
Copy link
Member

What changes were proposed in this pull request?

The test suites that extend HadoopFsRelationTest are not in sql/hive packages, but their directories are in sql/hive. We should move them to sql/core.

How was this patch tested?

The existing tests.

}
}

class HiveOrcHadoopFsRelationSuite extends OrcHadoopFsRelationSuite {
Copy link
Member Author

@gatorsmile gatorsmile Jan 19, 2018

Choose a reason for hiding this comment

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

This is Hive only. Thus, create a separate file for it.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you!

spark.range(0, 10).write
.orc(file.getCanonicalPath)
val expectedCompressionKind =
OrcFileOperator.getFileReader(file.getCanonicalPath).get.getCompression
Copy link
Member Author

Choose a reason for hiding this comment

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

OrcFileOperator is defined in sql\hive.

Copy link
Member

Choose a reason for hiding this comment

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

@gatorsmile . This test case should be tested on native implementation, too.
HiveOrcHadoopFsRelationSuite test coverage is only hive implementation.

assert(maybeOrcFile.isDefined)
val orcFilePath = maybeOrcFile.get.toPath.toString
val expectedCompressionKind =
OrcFileOperator.getFileReader(orcFilePath).get.getCompression
Copy link
Member Author

Choose a reason for hiding this comment

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

The same here.

@gatorsmile
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented Jan 19, 2018

Test build #86392 has finished for PR 20331 at commit f7693f0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • abstract class HadoopFsRelationTest extends QueryTest with SQLTestUtils with SharedSQLContext
  • class JsonHadoopFsRelationSuite extends HadoopFsRelationTest
  • class OrcHadoopFsRelationSuite extends HadoopFsRelationTest
  • class ParquetHadoopFsRelationSuite extends HadoopFsRelationTest
  • class SimpleTextHadoopFsRelationSuite extends HadoopFsRelationTest with PredicateHelper
  • class SimpleTextSource extends TextBasedFileFormat with DataSourceRegister
  • class SimpleTextOutputWriter(path: String, dataSchema: StructType, context: TaskAttemptContext)
  • class HiveOrcHadoopFsRelationSuite extends OrcHadoopFsRelationSuite

@SparkQA
Copy link

SparkQA commented Jan 19, 2018

Test build #86393 has finished for PR 20331 at commit f7693f0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • abstract class HadoopFsRelationTest extends QueryTest with SQLTestUtils with SharedSQLContext
  • class JsonHadoopFsRelationSuite extends HadoopFsRelationTest
  • class OrcHadoopFsRelationSuite extends HadoopFsRelationTest
  • class ParquetHadoopFsRelationSuite extends HadoopFsRelationTest
  • class SimpleTextHadoopFsRelationSuite extends HadoopFsRelationTest with PredicateHelper
  • class SimpleTextSource extends TextBasedFileFormat with DataSourceRegister
  • class SimpleTextOutputWriter(path: String, dataSchema: StructType, context: TaskAttemptContext)
  • class HiveOrcHadoopFsRelationSuite extends OrcHadoopFsRelationSuite

@SparkQA
Copy link

SparkQA commented Jan 19, 2018

Test build #86402 has finished for PR 20331 at commit b83f859.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • abstract class HadoopFsRelationTest extends QueryTest with SQLTestUtils
  • class JsonHadoopFsRelationSuite extends HadoopFsRelationTest with SharedSQLContext
  • abstract class OrcHadoopFsRelationBase extends HadoopFsRelationTest
  • class ParquetHadoopFsRelationSuite extends HadoopFsRelationTest with SharedSQLContext
  • class HiveOrcHadoopFsRelationSuite extends OrcHadoopFsRelationBase with TestHiveSingleton

@gatorsmile
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented Jan 20, 2018

Test build #86403 has finished for PR 20331 at commit b83f859.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • abstract class HadoopFsRelationTest extends QueryTest with SQLTestUtils
  • class JsonHadoopFsRelationSuite extends HadoopFsRelationTest with SharedSQLContext
  • abstract class OrcHadoopFsRelationBase extends HadoopFsRelationTest
  • class ParquetHadoopFsRelationSuite extends HadoopFsRelationTest with SharedSQLContext
  • class HiveOrcHadoopFsRelationSuite extends OrcHadoopFsRelationBase with TestHiveSingleton

@SparkQA
Copy link

SparkQA commented Jan 20, 2018

Test build #86412 has finished for PR 20331 at commit 9c85b18.

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

@gatorsmile
Copy link
Member Author

cc @cloud-fan

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

Please keep the test coverage for the following two test cases for native ORCFileFormat.

test("SPARK-13543: Support for specifying compression codec for ORC via option()")
test("Default compression codec is snappy for ORC compression")

spark.range(0, 10).write
.orc(file.getCanonicalPath)
val expectedCompressionKind =
OrcFileOperator.getFileReader(file.getCanonicalPath).get.getCompression
Copy link
Member

Choose a reason for hiding this comment

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

@gatorsmile . This test case should be tested on native implementation, too.
HiveOrcHadoopFsRelationSuite test coverage is only hive implementation.

val df =
spark.read.format(dataSourceName).option("multiLine", true).schema(schema).load(path)
checkAnswer(df, Row(null, expected))
withSQLConf(SQLConf.MAX_RECORDS_PER_FILE.key -> "2") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

The test will fail if SQLConf.MAX_RECORDS_PER_FILE.key is less than 2

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the default value won't be less than 2, we don't need to be so careful...

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Mar 11, 2018

Please remember this comment during next update, @gatorsmile . Thanks.

@gatorsmile gatorsmile closed this Jul 30, 2018
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.

5 participants