Giter VIP home page Giter VIP logo

Comments (8)

neel-bp avatar neel-bp commented on May 26, 2024

we are having the same problem, it only started happening after we updated clickhouse to 24.4.1 revision 54467
for us the query is like this

SELECT 
			'current' as period,
			date(event_time,'America/Los_Angeles') as label,
			arrayFilter(x -> dateDiff('day', event_time, toDateTime(parseDateTime64BestEffortOrZero(JSONExtractString(x, 'event_time')))) >= 0 and dateDiff('day', event_time, toDateTime(parseDateTime64BestEffortOrZero(JSONExtractString(x, 'event_time')))) < 14, workflows) as a
		FROM 
			orders
		WHERE 
			domain_id='xxx' 
			AND date(event_time,'America/Los_Angeles') BETWEEN '2024-04-07' AND '2024-05-07'  
	    limit 20

when removing the arrayFilter, query works

from clickhouse.

Algunenano avatar Algunenano commented on May 26, 2024

Issues are simpler to investigate if you provide reproducible examples -> https://fiddle.clickhouse.com/

from clickhouse.

neel-bp avatar neel-bp commented on May 26, 2024

also just checked this problem is only happening with distributed tables, i tried running the same query on the local table and it is working fine.

from clickhouse.

livingston0318 avatar livingston0318 commented on May 26, 2024

Issues are simpler to investigate if you provide reproducible examples -> https://fiddle.clickhouse.com/

CREATE TABLE users (uid Int16, name String, age Int16) ENGINE=Memory;

INSERT INTO users VALUES (1231, 'John', 33);
INSERT INTO users VALUES (6666, 'Ksenia', 48);
INSERT INTO users VALUES (8888, 'Alice', 50);

with test AS (
select uid from users
where age > 40
)
select
uid,
name,
age
from
users
where
uid in (test.uid);

from clickhouse.

livingston0318 avatar livingston0318 commented on May 26, 2024

it can reproduce with the sql I just posted. @Algunenano
also, you can successfully run the SQL just replace test.uid with test

from clickhouse.

den-crane avatar den-crane commented on May 26, 2024

@livingston0318 you should use a subquery

with test AS ( select uid from users where age > 40 )
  select uid,name, age
  from users
  where uid in (select uid from test);

https://fiddle.clickhouse.com/67c86990-4d3f-400b-ab8b-6ca5cbeb59e7


with test AS ( select uid from users where age > 40 )
  select uid,name, age
  from users
  where uid in (test.uid);

Such syntax is not supported by other databases, PG, Mysql. It was an undefined behaviour that it worked before.
I think it's good that it does not work anymore.
The issue should be closed after adding positive and negative tests.

from clickhouse.

den-crane avatar den-crane commented on May 26, 2024

Ah, I see, it never worked at all. https://fiddle.clickhouse.com/749eb4c7-5b07-4da9-a640-da57e89a2b6e

from clickhouse.

livingston0318 avatar livingston0318 commented on May 26, 2024

@den-crane thanks bro, this issue can be closed.

from clickhouse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.