Skip to content

Commit

Permalink
[Bug] Cached clickhouse table is not used by SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyifan279 committed Oct 20, 2023
1 parent 48104e1 commit 86b8b07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ trait ClickHouseHelper extends Logging {
uuid = tableRow.get("uuid").asText,
engine = tableRow.get("engine").asText,
is_temporary = tableRow.get("is_temporary").asBoolean,
data_paths = tableRow.get("data_paths").elements().asScala.map(_.asText).toArray,
data_paths = tableRow.get("data_paths").elements().asScala.map(_.asText).toList,
metadata_path = tableRow.get("metadata_path").asText,
metadata_modification_time = LocalDateTime.parse(
tableRow.get("metadata_modification_time").asText,
dateTimeFmt.withZone(tz)
),
dependencies_database = tableRow.get("dependencies_database").elements().asScala.map(_.asText).toArray,
dependencies_table = tableRow.get("dependencies_table").elements().asScala.map(_.asText).toArray,
dependencies_database = tableRow.get("dependencies_database").elements().asScala.map(_.asText).toList,
dependencies_table = tableRow.get("dependencies_table").elements().asScala.map(_.asText).toList,
create_table_query = tableRow.get("create_table_query").asText,
engine_full = tableRow.get("engine_full").asText,
partition_key = tableRow.get("partition_key").asText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class ClickHouseSingleSuite extends SparkClickHouseSingleTest {
withSimpleTable(db, tbl, true) {
try {
spark.sql(s"CACHE TABLE $db.$tbl")
val cachedPlan = spark.sql(s"SELECT * FROM $db.$tbl").queryExecution.normalized
val cachedPlan = spark.sql(s"SELECT * FROM $db.$tbl").queryExecution.commandExecuted
.find(node => spark.sharedState.cacheManager.lookupCachedData(node).isDefined)
assert(cachedPlan.isDefined)
} finally
Expand Down

0 comments on commit 86b8b07

Please sign in to comment.