mirror of
https://github.com/apache/impala.git
synced 2026-01-03 15:00:52 -05:00
Fixes a bug (regression) where the catalog server was not properly resolving column names when a table's column definition did not match its Avro schema definition. The expected behavior in this case is that the the Avro scehma definition should be used instead of the table columns. We had no test tables that were mismatched so this wasn't caught. This loading of the schema and columns happens when a table's metadata is loaded, so the fix is to just add a toThrift() to Column and not reference metastore.getSd().getCols() directly since it might be the "wrong" set of columns. Change-Id: I341a3a8834f5748f90c246d2093ddb983ecfdd4f Reviewed-on: http://gerrit.ent.cloudera.com:8080/770 Reviewed-by: Lenni Kuff <lskuff@cloudera.com> Tested-by: Lenni Kuff <lskuff@cloudera.com>
This folder contains the files necessary to test Impala support for Avro schema resolution (along with the TestAvroSchemaResolution query test). create_table.sql creates a functional_avro_snap.schema_resolution_test table and loads records1.avro and records2.avro. The .avro files were created via the following commands: java -jar ~/avro-tools-1.7.4.jar fromjson --schema-file file_schema1.avsc --codec snappy records1.json > records1.avro java -jar ~/avro-tools-1.7.4.jar fromjson --schema-file file_schema2.avsc --codec snappy records2.json > records2.avro create_table.sql, file_schema1.avsc and file_schema2.avsc contain the relevant schema definitions.