I am new to avro and while trying to use avro alias property i am getting below error.
Query : select department_id , office_name from test.depart_alias;
SemanticException [Error 10004]: Line 1:23 Invalid table alias or column reference 'office_name': (possible column names are: department_id, department_name)
My json file for avsc format is
{
"type" : "record",
"name" : "departments",
"doc" : "Sqoop import of departments",
"fields" : [ {
"name" : "department_id",
"type" : [ "null", "int" ],
"default" : null,
"columnName" : "department_id",
"sqlType" : "4"
}, {
"name" : "department_name",
"type" : [ "null", "string" ],
"default" : null,
"aliases" : [ "office_name" ],
"columnName" : "department_name",
"sqlType" : "12"
} ],
"tableName" : "departments"
I want to use office name as alias to department_name. How should i implement it
Thanks