Skip to content

SPARK-3807: SparkSql does not work for tables created using custom serde #2674

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private[hive] case class MetastoreRelation
val partitionKeys = hiveQlTable.getPartitionKeys.map(_.toAttribute)

/** Non-partitionKey attributes */
val attributes = table.getSd.getCols.map(_.toAttribute)
val attributes = hiveQlTable.getCols.map(_.toAttribute)

val output = attributes ++ partitionKeys
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ case class HiveTableScan(
ColumnProjectionUtils.appendReadColumnIDs(hiveConf, neededColumnIDs)
ColumnProjectionUtils.appendReadColumnNames(hiveConf, attributes.map(_.name))

val tableDesc = relation.tableDesc
val deserializer = tableDesc.getDeserializerClass.newInstance
deserializer.initialize(hiveConf, tableDesc.getProperties)

// Specifies types and object inspectors of columns to be scanned.
val structOI = ObjectInspectorUtils
.getStandardObjectInspector(
relation.tableDesc.getDeserializer.getObjectInspector,
deserializer.getObjectInspector,
ObjectInspectorCopyOption.JAVA)
.asInstanceOf[StructObjectInspector]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ class HiveQuerySuite extends HiveComparisonTest {
clear()
}

createQueryTest("select from thrift based table",
"SELECT * from src_thrift")

// Put tests that depend on specific Hive settings before these last two test,
// since they modify /clear stuff.
}
Expand Down