Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/15136#discussion_r79298630
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala ---
@@ -290,6 +290,27 @@ class StatisticsSuite extends QueryTest with
TestHiveSingleton with SQLTestUtils
}
}
+ test("alter table set location after analyze table") {
+ val textTable = "textTable"
+ withTable(textTable) {
+ sql(s"CREATE TABLE $textTable (key STRING, value STRING) STORED AS
TEXTFILE")
+ sql(s"INSERT INTO TABLE $textTable SELECT * FROM src")
+ sql(s"ANALYZE TABLE $textTable COMPUTE STATISTICS")
+ checkStats(
+ textTable, isDataSourceTable = false, hasSizeInBytes = true,
expectedRowCounts = Some(500))
+
+ withTempDir { tmpDir =>
+ val path = tmpDir.getCanonicalPath
+ sql(s"ALTER TABLE $textTable SET LOCATION '$path'")
+ checkStats(
+ textTable,
+ isDataSourceTable = false,
+ hasSizeInBytes = false,
--- End diff --
After the PR: https://github.com/apache/spark/pull/14971, we can reuse the
Hive-generated statistics. Thus, this value will be `true`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]