Quanlong Huang created IMPALA-11824:
---------------------------------------
Summary: View that cast column to the same type cannot be used
Key: IMPALA-11824
URL: https://issues.apache.org/jira/browse/IMPALA-11824
Project: IMPALA
Issue Type: Bug
Components: Frontend
Reporter: Quanlong Huang
I found this when debugging for another issue. For views that cast columns to
the same types, any usage of it will failed with "Could not resolve
column/field reference" error. Here's an example:
{code:java}
create table t (id int) stored as textfile;
insert into t select 1;
create view v(id) as select cast(id as int) from t;
select * from v;
ERROR: AnalysisException: Could not resolve column/field reference: 'v._c0'
select id from v;
ERROR: AnalysisException: Could not resolve column/field reference: 'v._c0'
# Casting id to a different type works
create view v2(id) as select cast(id as tinyint) from t;
+----+
| id |
+----+
| 1 |
+----+
# Don't specifying the view column names also works
create view v3 as select cast(id as tinyint) from t;
+-----+
| _c0 |
+-----+
| 1 |
+-----+{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]