apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.34k stars 3.21k forks source link

[Bug] There is an problem with the execution of the lag function on nested array type fields #35609

Open wandayou opened 3 months ago

wandayou commented 3 months ago

Search before asking

Version

2.1

What's Wrong?

表dwd_content_detail中存在字段:feature_embedding ARRAY<ARRAY< FLOAT >>,且部分记录中该字段值为空,然后当执行sql( SELECT id,feature_embedding,lag(feature_embedding,1,null) over (partition by id) as feature_embedding_lag FROM dwd_content_detail)时会报错: org.jkiss.dbeaver.model.sql.DBSQLException: SQL 错误 [1105] [HY000]: errCode = 2, detailMessage = No matching function with signature: lag(ARRAY, BIGINT, NULL_TYPE). at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133) at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:614) at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$2(SQLQueryJob.java:505) at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190) at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:524) at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:976) at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:4133) at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:123) at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190)

What You Expected?

execute normally

How to Reproduce?

execute sql: SELECT id,feature_embedding,lag(feature_embedding,1,null) over (partition by id) as feature_embedding_lag FROM dwd_content_detail

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

felixwluo commented 3 months ago

Table structure and query statements?

wandayou commented 3 months ago

这是一封自动回复邮件。已经收到您的来信,我会尽快回复。谢谢!                                                               ---万大友

wandayou commented 3 months ago

Table structure and query statements?

CREATE TABLE IF NOT EXISTS dwd_content_detail ( id varchar(80), feature_embedding array<array< FLOAT >> ) UNIQUE KEY(id) DISTRIBUTED BY HASH(id) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "enable_unique_key_merge_on_write" = "true", "light_schema_change" = "true", "store_row_column" = "true", "compression"="zstd" );

SELECT id,feature_embedding,lag(feature_embedding,1,null) over (partition by id) as feature_embedding_lag FROM dwd_content_detail