Skip to content
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

bug: bad batch query succeeds when QUERY_MODE is distributed #18790

Closed
stdrc opened this issue Oct 3, 2024 · 0 comments · Fixed by #18812
Closed

bug: bad batch query succeeds when QUERY_MODE is distributed #18790

stdrc opened this issue Oct 3, 2024 · 0 comments · Fixed by #18812
Labels
type/bug Something isn't working
Milestone

Comments

@stdrc
Copy link
Member

stdrc commented Oct 3, 2024

The following batch query should fail to execute, although it should pass the binder, because generate_series(timestamptz, timestamptz, interval) is not supported in batch mode (no such function implementation).

select * from generate_series(
  '2024-06-21 17:36:00'::timestamptz,
  now(),
  interval '1 hour'
);

However, what's weird is that, this query failed in local mode, but succeeded in distributed mode.

dev=> SET QUERY_MODE TO local;
SET_VARIABLE
dev=> select * from generate_series(
  '2024-06-21 17:36:00'::timestamptz,
  now(),
  interval '1 hour'
);
NOTICE:  Your session timezone is UTC. It was used in the interpretation of timestamps and dates in your query. If this is unintended, change your timezone to match that of your data's with `set timezone = [timezone]` or rewrite your query with an explicit timezone conversion, e.g. with `AT TIME ZONE`.

ERROR:  Failed to run the query

Caused by these errors (recent errors listed first):
  1: failed to build executor
  2: Expr error
  3: Unsupported function: generate_series(timestamp with time zone, timestamp with time zone, interval) -> timestamp with time zone
HINT: Supported functions:
  generate_series(bigint, bigint) -> bigint
  generate_series(integer, integer) -> integer
  generate_series(numeric, numeric) -> numeric
  generate_series(timestamp without time zone, timestamp without time zone, interval) -> timestamp without time zone
  generate_series(bigint, bigint, bigint) -> bigint
  generate_series(integer, integer, integer) -> integer
  generate_series(numeric, numeric, numeric) -> numeric

dev=> SET QUERY_MODE TO distributed;
SET_VARIABLE
dev=> select * from generate_series(
  '2024-06-21 17:36:00'::timestamptz,
  now(),
  interval '1 hour'
);
NOTICE:  Your session timezone is UTC. It was used in the interpretation of timestamps and dates in your query. If this is unintended, change your timezone to match that of your data's with `set timezone = [timezone]` or rewrite your query with an explicit timezone conversion, e.g. with `AT TIME ZONE`.

 generate_series 
-----------------
(0 rows)
@stdrc stdrc added the type/bug Something isn't working label Oct 3, 2024
@github-actions github-actions bot added this to the release-2.1 milestone Oct 3, 2024
@stdrc stdrc changed the title bug: bad batch query succeeds when QUERY_MODE is dsitributed bug: bad batch query succeeds when QUERY_MODE is distributed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
1 participant