question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HiveServer2Error: Error while compiling statement: FAILED: SemanticException [Error 10025]: Line 1:7 Expression not in GROUP BY key 'day'

See original GitHub issue

image image I created a table and when I sql query everything works fine. but when I use ibis, it gives the error above.

hive_cursor.execute('CREATE TABLE default.demo_table_ibis4 (day STRING, sales INTEGER)')
hive_cursor.execute("insert into default.demo_table_ibis4 values ('Monday', 50)")
hive_cursor.execute("insert into default.demo_table_ibis4 values ('Monday', 20)")
hive_cursor.execute("insert into default.demo_table_ibis4 values ('Tuesday', 50)")
hive_cursor.execute("insert into default.demo_table_ibis4 values ('Tuesday', 100)")

hive_cursor.execute('SELECT * FROM default.demo_table_ibis4 LIMIT 100')

hive_cursor.execute("SELECT day, avg(sales) as avg FROM default.demo_table_ibis4 group by day ")

df_hive = pd.DataFrame(hive_cursor.fetchall(), columns=[col[0] for col in hive_cursor.description])
df_hive

df_hive.groupby("demo_table_ibis4.day").mean("demo_table_ibis4.sales")

ibis.options.interactive = True
ibis.options.verbose = True

hello_world = client_ibis.database("default").table('demo_table_ibis4')

hello_world

hello_world \
    .group_by('day') \
    .aggregate( \
         avg=hello_world.sales.mean() \
      ) \
 .execute()

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cpcloudcommented, Apr 7, 2022

image

This looks more like a question, let’s try and keep that separate from your original issue.

0reactions
cpcloudcommented, Apr 8, 2022

I can confirm that this setting allows GROUP BY 1 to work using the docker compose setup here: https://github.com/big-data-europe/docker-hive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

hive Expression Not In Group By Key - Stack Overflow
The full error message should be in the format Expression Not In Group By Key [value] . The [value] will tell you what...
Read more >
HIVE SQL [Error 10025]: Expression not in GROUP BY key
I want to GROUP by & HAVING based on column 'ip_address', if more than 20 records. SELECT day, ip_address, user, request FROM my_table...
Read more >
Group by one variable with selecting more than one... - 111412
Error while compiling statement : FAILED: SemanticException [Error 10025]: Line 10:0 Expression not in GROUP BY key 'prov_id_new'.
Read more >
Aggregated Expression not in GROUP BY key
Hi, I am using Hive 1.2, and I am trying to run some queries based on TPCH schema. My original query is: SELECT...
Read more >
hive - "Expression Not In Group By Key" - Just one line it
First of a long series as I am starting to use Hive on a daily basis for a data mining project. Ever got...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found