[
https://issues.apache.org/jira/browse/HIVE-23902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
cheng yong updated HIVE-23902:
------------------------------
Affects Version/s: 3.1.2
> SemanticException: not find table in genColumnStatsTask when compile a sql
> ---------------------------------------------------------------------------
>
> Key: HIVE-23902
> URL: https://issues.apache.org/jira/browse/HIVE-23902
> Project: Hive
> Issue Type: Bug
> Affects Versions: 3.1.2
> Environment: hadoop3.2.1+hive3.1.2
> Reporter: cheng yong
> Priority: Major
>
> Error: Error while compiling statement: FAILED: SemanticException Can not
> find test.test3 in genColumnStatsTask (state=42000,code=40000)
>
> {code:java}
> explain insert into table test.test3 partition(p1 = 'p1', p2 = 'p2')
> select p1_name,
> indic_id,
> indic_name,
> case when indic_id in ('101','102') then cast(cast(indic_value as double) as
> string)
> else cast(cast(indic_value as bigint) as string) end as indic_value,
> dod
> from
> (select 'p1' as p1_name,
> c.indic_id,
> case when c.indic_id = '101' then 'a101'
> end as indic_name,
> c.indic_array[0] as indic_value,
> c.indic_array[1] dod
> from (select b.indic_id, b.indic_array
> from (select c1,
> c2
> from test.test1
> where p1 = 'p1' and p2='p1'
> ) a
> lateral view explode(map('101', array(c1,c2))
> ) b as indic_id, indic_array
> ) c
> union all
> select 'p1' as p1_name,
> c2.indic_id,
> case when c2.indic_id = '102' then 'a102'
> end as indic_name,
> c2.indic_array[0] as indic_value,
> c2.indic_array[1] dod
> from (select b.indic_id, b.indic_array
> from (select c3,
> c4
> from test.test2
> where p1 = 'p1' and p2='p2'
> ) a
> lateral view explode(map('102', array(c3,c4))
> ) b as indic_id, indic_array
> ) c2
> ) tt
> ;
> {code}
>
>
> I try to change GenMapRedUtils.java,the error disappear,but I don't know if
> this modification is correct。(row:1887)
>
> {code:java}
> // if ((srcDir != null) && srcDir.equals(fsopFinalDir)) {
> if (srcDir != null && fsopFinalDir!=null) {
> if(srcDir.equals(fsopFinalDir)) {
> return mvTsk;
> } else if(fsopFinalDir.getParent().equals(srcDir)) {
> LOG.info("====== fsopFinalDir parent equals mvTsk path ======");
> return mvTsk;
> }
> }
>
> {code}
>
>
> create table sql:
> {code:java}
> CREATE TABLE `test.test1`(
> `c1` bigint,
> `c2` double)
> PARTITIONED BY (
> `p1` string,
> `p2` string)
> ROW FORMAT SERDE
> 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
> STORED AS INPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
> OUTPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
> CREATE TABLE `test.test2`(
> `c3` bigint,
> `c4` double)
> PARTITIONED BY (
> `p1` string,
> `p2` string)
> ROW FORMAT SERDE
> 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
> STORED AS INPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
> OUTPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
> CREATE TABLE `test.test3`(
> `p1_name` string,
> `indic_id` string,
> `indic_name` string,
> `indic_value` string,
> `dod` string)
> PARTITIONED BY (
> `p1` string,
> `p2` string)
> ROW FORMAT SERDE
> 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
> STORED AS INPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
> OUTPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)