Quantcast
Channel: DataStax Support Forums » Recent Topics
Viewing all articles
Browse latest Browse all 387

lin_qiang on "In Hive service, a query with Max or Min method that argument is a constant value may failed"

$
0
0

When I study the DataStax Hive, I found an unaccountable issue.

If a SQL contains MAX or MIN method with a argument that come from a constant value, the server may think the SQL need not read database, then it will failed.

For example:
select max(1) from table; --failed
select max(true) from table; --failed;
select max(a) from (select 1 a from table); --failed;
select max(a) from (select field a from table); --ok
select max(field) from table; --ok

The error message is:
Job Submission failed with exception 'java.io.IOException(cannot find dir = cfs://127.0.0.1/user/root/fake-path-metadata-only-query-xxxx.xxxx{} in pathToPartitionInfo: [fake-path-metadata-only-query-xxxx.xxxx{}])'
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MapRedTask

Now, I plus a random database operation to SQL, then that issue resolved.
select max(1) from table where field is null or field is not null; --OK
select max(true) from table where field is null or field is not null; --OK;
select max(a) from (select 1 a from table where field is null or field is not null); --OK;

But the query's speed will become to slower.


Viewing all articles
Browse latest Browse all 387

Trending Articles