Skip to content
Merged
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 @@ -59,9 +59,10 @@ static Schema getSchema(org.apache.hadoop.hive.metastore.api.Table table) {
org.apache.avro.Schema avroSchema = schemaStr != null ? new org.apache.avro.Schema.Parser().parse(schemaStr) : null;
Schema schema;
if (avroSchema != null) {
FileFormat format = serdeToFileFormat(table.getSd().getSerdeInfo().getSerializationLib());
String serde = table.getSd().getSerdeInfo().getSerializationLib();
org.apache.avro.Schema finalAvroSchema;
if (format.equals(FileFormat.AVRO) || HasDuplicateLowercaseColumnNames.visit(avroSchema)) {
if (serde.equals("org.apache.hadoop.hive.serde2.avro.AvroSerDe") ||
HasDuplicateLowercaseColumnNames.visit(avroSchema)) {
// Case 1: If serde == AVRO, early escape; Hive column info is not reliable and can be empty for these tables
// Hive itself uses avro.schema.literal as source of truth for these tables, so this should be fine
// Case 2: If avro.schema.literal has duplicate column names when lowercased, that means we cannot do reliable
Expand Down