hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiaomeng Huang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-16936) wrong result with CTAS(create table as select)
Date Thu, 22 Jun 2017 03:31:00 GMT

     [ https://issues.apache.org/jira/browse/HIVE-16936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Xiaomeng Huang updated HIVE-16936:
----------------------------------
    Description: 
1. 
{code}
hive> desc abc_test_old;
OK
did                 	string
activetime          	int
{code}

2. 
{code}
hive> select 'test' as did from abc_test_old
    > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;
OK
test  
{code}
result is 'test'

3. 
{code}
hive> create table abc_test_12345 as
    > select 'test' as did from abc_test_old
    > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;

hive> select did from abc_test_12345 limit 1;
OK
5FCAFD34-C124-4E13-AF65-27B675C945CC 
{code}
result is '5FCAFD34-C124-4E13-AF65-27B675C945CC'
why result is not 'test'?

4. 
{code}
hive> explain
    > create table abc_test_12345 as
    > select 'test' as did from abc_test_old
    > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;
OK
STAGE DEPENDENCIES:
  Stage-1 is a root stage
  Stage-6 depends on stages: Stage-1 , consists of Stage-3, Stage-2, Stage-4
  Stage-3
  Stage-0 depends on stages: Stage-3, Stage-2, Stage-5
  Stage-7 depends on stages: Stage-0
  Stage-2
  Stage-4
  Stage-5 depends on stages: Stage-4

STAGE PLANS:
  Stage: Stage-1
    Map Reduce
      Map Operator Tree:
          TableScan
            alias: abc_test_old
            Statistics: Num rows: 32 Data size: 1152 Basic stats: COMPLETE Column stats: NONE
            Filter Operator
              predicate: (did = '5FCAFD34-C124-4E13-AF65-27B675C945CC') (type: boolean)
              Statistics: Num rows: 16 Data size: 576 Basic stats: COMPLETE Column stats:
NONE
              Select Operator
                Statistics: Num rows: 16 Data size: 576 Basic stats: COMPLETE Column stats:
NONE
                Limit
                  Number of rows: 1
                  Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats:
NONE
                  Reduce Output Operator
                    sort order:
                    Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats:
NONE
      Reduce Operator Tree:
        Select Operator
          expressions: '5FCAFD34-C124-4E13-AF65-27B675C945CC' (type: string)
          outputColumnNames: _col0
          Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats: NONE
          Limit
            Number of rows: 1
            Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats: NONE
            File Output Operator
              compressed: true
              Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats: NONE
              table:
                  input format: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
                  output format: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
                  serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde
                  name: default.abc_test_12345
......
{code}
why expressions is '5FCAFD34-C124-4E13-AF65-27B675C945CC'

  was:
1. 
{code}
hive> select 'test' as did from abc_test_old
    > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;
OK
test  
{code}
result is 'test'

2. 
{code}
hive> create table abc_test_12345 as
    > select 'test' as did from abc_test_old
    > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;

hive> select did from abc_test_12345 limit 1;
OK
5FCAFD34-C124-4E13-AF65-27B675C945CC 
{code}
result is '5FCAFD34-C124-4E13-AF65-27B675C945CC'
why result is not 'test'?

3. 
{code}
hive> explain
    > create table abc_test_12345 as
    > select 'test' as did from abc_test_old
    > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;
OK
STAGE DEPENDENCIES:
  Stage-1 is a root stage
  Stage-6 depends on stages: Stage-1 , consists of Stage-3, Stage-2, Stage-4
  Stage-3
  Stage-0 depends on stages: Stage-3, Stage-2, Stage-5
  Stage-7 depends on stages: Stage-0
  Stage-2
  Stage-4
  Stage-5 depends on stages: Stage-4

STAGE PLANS:
  Stage: Stage-1
    Map Reduce
      Map Operator Tree:
          TableScan
            alias: abc_test_old
            Statistics: Num rows: 32 Data size: 1152 Basic stats: COMPLETE Column stats: NONE
            Filter Operator
              predicate: (did = '5FCAFD34-C124-4E13-AF65-27B675C945CC') (type: boolean)
              Statistics: Num rows: 16 Data size: 576 Basic stats: COMPLETE Column stats:
NONE
              Select Operator
                Statistics: Num rows: 16 Data size: 576 Basic stats: COMPLETE Column stats:
NONE
                Limit
                  Number of rows: 1
                  Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats:
NONE
                  Reduce Output Operator
                    sort order:
                    Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats:
NONE
      Reduce Operator Tree:
        Select Operator
          expressions: '5FCAFD34-C124-4E13-AF65-27B675C945CC' (type: string)
          outputColumnNames: _col0
          Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats: NONE
          Limit
            Number of rows: 1
            Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats: NONE
            File Output Operator
              compressed: true
              Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats: NONE
              table:
                  input format: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
                  output format: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
                  serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde
                  name: default.abc_test_12345
......
{code}
why expressions is '5FCAFD34-C124-4E13-AF65-27B675C945CC'


> wrong result with CTAS(create table as select)
> ----------------------------------------------
>
>                 Key: HIVE-16936
>                 URL: https://issues.apache.org/jira/browse/HIVE-16936
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Xiaomeng Huang
>            Priority: Critical
>
> 1. 
> {code}
> hive> desc abc_test_old;
> OK
> did                 	string
> activetime          	int
> {code}
> 2. 
> {code}
> hive> select 'test' as did from abc_test_old
>     > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;
> OK
> test  
> {code}
> result is 'test'
> 3. 
> {code}
> hive> create table abc_test_12345 as
>     > select 'test' as did from abc_test_old
>     > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;
> hive> select did from abc_test_12345 limit 1;
> OK
> 5FCAFD34-C124-4E13-AF65-27B675C945CC 
> {code}
> result is '5FCAFD34-C124-4E13-AF65-27B675C945CC'
> why result is not 'test'?
> 4. 
> {code}
> hive> explain
>     > create table abc_test_12345 as
>     > select 'test' as did from abc_test_old
>     > where did = '5FCAFD34-C124-4E13-AF65-27B675C945CC' limit 1;
> OK
> STAGE DEPENDENCIES:
>   Stage-1 is a root stage
>   Stage-6 depends on stages: Stage-1 , consists of Stage-3, Stage-2, Stage-4
>   Stage-3
>   Stage-0 depends on stages: Stage-3, Stage-2, Stage-5
>   Stage-7 depends on stages: Stage-0
>   Stage-2
>   Stage-4
>   Stage-5 depends on stages: Stage-4
> STAGE PLANS:
>   Stage: Stage-1
>     Map Reduce
>       Map Operator Tree:
>           TableScan
>             alias: abc_test_old
>             Statistics: Num rows: 32 Data size: 1152 Basic stats: COMPLETE Column stats:
NONE
>             Filter Operator
>               predicate: (did = '5FCAFD34-C124-4E13-AF65-27B675C945CC') (type: boolean)
>               Statistics: Num rows: 16 Data size: 576 Basic stats: COMPLETE Column stats:
NONE
>               Select Operator
>                 Statistics: Num rows: 16 Data size: 576 Basic stats: COMPLETE Column
stats: NONE
>                 Limit
>                   Number of rows: 1
>                   Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column
stats: NONE
>                   Reduce Output Operator
>                     sort order:
>                     Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column
stats: NONE
>       Reduce Operator Tree:
>         Select Operator
>           expressions: '5FCAFD34-C124-4E13-AF65-27B675C945CC' (type: string)
>           outputColumnNames: _col0
>           Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats: NONE
>           Limit
>             Number of rows: 1
>             Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats:
NONE
>             File Output Operator
>               compressed: true
>               Statistics: Num rows: 1 Data size: 36 Basic stats: COMPLETE Column stats:
NONE
>               table:
>                   input format: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
>                   output format: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
>                   serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde
>                   name: default.abc_test_12345
> ......
> {code}
> why expressions is '5FCAFD34-C124-4E13-AF65-27B675C945CC'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message