-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to use "group by" sql #67
Comments
probably because day is a reserved word. you should try:
select a.day,count(*) from tb_name a group by a.day
hope this helps,
Zachi Klopman
…On Tue, Jan 3, 2017 at 11:51 AM, 于瑞东 ***@***.***> wrote:
I execute "select day,count(*) from tb_name group by day" .
raise Pyhs2Exception(res.status.errorCode, res.status.errorMessage)
pyhs2.error.Pyhs2Exception: 'Error while processing statement: FAILED:
Execution Error, return code 1 from org.apache.hadoop.hive.ql.
exec.mr.MapRedTask'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#67>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGG0tpCN2sUUIMOABsxvB-pJtF6B2Gmcks5rOnx5gaJpZM4LZzU9>
.
|
this problem is still happended |
@zklopman execute "select a.day from tb_name a" is ok |
Hi,
If I understand you correctly:
select a.day,count( * ) from tb_name a group by a.day
does not work, while:
select a.day from tb_name a
does. As I do not have access to a hive system anymore, I can only assume
that maybe the asterix also needs to have the alias. Try:
select a.day,count( a.* ) from tb_name a group by a.day
or
select a.day,count( 1 ) from tb_name a group by a.day
These should behave the same in this context, but in more complex queries
they do not.
hope this helps,
Zachi
…On Wed, Jan 4, 2017 at 12:52 AM, 于瑞东 ***@***.***> wrote:
@zklopman <https://github.com/zklopman> execute "select a.day from
tb_name a" is ok
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGG0toobgHk_gTnh9nLF95AlhGfslFxbks5rOzOmgaJpZM4LZzU9>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I execute "select day,count(*) from tb_name group by day" .
raise Pyhs2Exception(res.status.errorCode, res.status.errorMessage)
pyhs2.error.Pyhs2Exception: 'Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask'
The text was updated successfully, but these errors were encountered: