xtdb / xtdb

An immutable database for application development and time-travel data compliance, with SQL and XTQL. Developed by @juxt
https://xtdb.com
Mozilla Public License 2.0
2.49k stars 160 forks source link

Odd error message when using GROUP BY and ORDER BY with non-aggregated column #3437

Open Akeboshiwind opened 1 week ago

Akeboshiwind commented 1 week ago

Play:

INSERT INTO docs (_id, foo, value) VALUES
  (1, 'bar', 1),
  (2, 'bar', 2),
  (3, 'foo', 3);

SELECT foo, count(*)
  FROM docs
  GROUP BY foo
  ORDER BY value

Give me this error:

Cannot invoke "org.apache.arrow.vector.types.pojo.Field.getType()" because "field" is null
refset commented 1 week ago

Completely different context (non-existent column on an ARROW_TABLE table file), same error (Play):

SELECT more_posts.t
  FROM ARROW_TABLE('https://xtdb.com/more_posts.arrow')
  AS more_posts (t);

For reference, the correct & working version is:

SELECT more_posts.text
  FROM ARROW_TABLE('https://xtdb.com/more_posts.arrow')
  AS more_posts (text);
refset commented 1 week ago

Also the same error message as https://github.com/xtdb/xtdb/issues/3337