mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-04 12:22:55 +00:00
fix: add missing error display message (#2791)
* fix: add missing error display message Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -180,7 +180,7 @@ pub enum Error {
|
||||
source: table::error::Error,
|
||||
},
|
||||
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("Internal error"))]
|
||||
Internal {
|
||||
location: Location,
|
||||
source: BoxedError,
|
||||
@@ -216,7 +216,7 @@ pub enum Error {
|
||||
#[snafu(display("Illegal access to catalog: {} and schema: {}", catalog, schema))]
|
||||
QueryAccessDenied { catalog: String, schema: String },
|
||||
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("DataFusion error"))]
|
||||
Datafusion {
|
||||
#[snafu(source)]
|
||||
error: DataFusionError,
|
||||
|
||||
@@ -44,7 +44,7 @@ pub enum Error {
|
||||
source: common_meta::error::Error,
|
||||
},
|
||||
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("External error"))]
|
||||
External {
|
||||
location: Location,
|
||||
source: BoxedError,
|
||||
@@ -170,7 +170,7 @@ pub enum Error {
|
||||
source: query::error::Error,
|
||||
},
|
||||
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("Operation to region server failed"))]
|
||||
InvokeRegionServer {
|
||||
location: Location,
|
||||
source: servers::error::Error,
|
||||
|
||||
@@ -25,7 +25,7 @@ use snafu::{Location, Snafu};
|
||||
#[snafu(visibility(pub))]
|
||||
#[stack_trace_debug]
|
||||
pub enum InnerError {
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("DataFusion error"))]
|
||||
Datafusion {
|
||||
#[snafu(source)]
|
||||
error: DataFusionError,
|
||||
|
||||
@@ -121,7 +121,7 @@ pub enum Error {
|
||||
location: Location,
|
||||
},
|
||||
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("DataFusion error"))]
|
||||
DataFusion {
|
||||
#[snafu(source)]
|
||||
error: DataFusionError,
|
||||
@@ -140,7 +140,7 @@ pub enum Error {
|
||||
source: sql::error::Error,
|
||||
},
|
||||
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("Failed to plan SQL"))]
|
||||
PlanSql {
|
||||
#[snafu(source)]
|
||||
error: DataFusionError,
|
||||
|
||||
@@ -76,7 +76,7 @@ pub enum Error {
|
||||
error: ArrowError,
|
||||
},
|
||||
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("DataFusion error"))]
|
||||
DataFusion {
|
||||
location: SnafuLocation,
|
||||
#[snafu(source)]
|
||||
|
||||
@@ -339,8 +339,12 @@ pub enum Error {
|
||||
source: crate::http::pprof::nix::Error,
|
||||
},
|
||||
|
||||
#[snafu(display(""))]
|
||||
Metrics { source: BoxedError },
|
||||
#[snafu(display("Failed to update jemalloc metrics"))]
|
||||
UpdateJemallocMetrics {
|
||||
#[snafu(source)]
|
||||
error: tikv_jemalloc_ctl::Error,
|
||||
location: Location,
|
||||
},
|
||||
|
||||
#[snafu(display("DataFrame operation error"))]
|
||||
DataFrame {
|
||||
@@ -408,7 +412,8 @@ impl ErrorExt for Error {
|
||||
| TcpIncoming { .. }
|
||||
| CatalogError { .. }
|
||||
| GrpcReflectionService { .. }
|
||||
| BuildHttpResponse { .. } => StatusCode::Internal,
|
||||
| BuildHttpResponse { .. }
|
||||
| UpdateJemallocMetrics { .. } => StatusCode::Internal,
|
||||
|
||||
CollectRecordbatch { .. } => StatusCode::EngineExecuteQuery,
|
||||
|
||||
@@ -479,8 +484,6 @@ impl ErrorExt for Error {
|
||||
#[cfg(feature = "pprof")]
|
||||
DumpPprof { source, .. } => source.status_code(),
|
||||
|
||||
Metrics { source } => source.status_code(),
|
||||
|
||||
ConvertScalarValue { source, .. } => source.status_code(),
|
||||
|
||||
ToJson { .. } => StatusCode::Internal,
|
||||
|
||||
@@ -12,10 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
mod error;
|
||||
|
||||
use common_telemetry::error;
|
||||
use error::UpdateJemallocMetricsSnafu;
|
||||
use lazy_static::lazy_static;
|
||||
use once_cell::sync::Lazy;
|
||||
use prometheus::*;
|
||||
@@ -23,6 +20,8 @@ use snafu::ResultExt;
|
||||
use tikv_jemalloc_ctl::stats::{allocated_mib, resident_mib};
|
||||
use tikv_jemalloc_ctl::{epoch, epoch_mib, stats};
|
||||
|
||||
use crate::error::UpdateJemallocMetricsSnafu;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref SYS_JEMALLOC_RESIDEN: IntGauge = register_int_gauge!(
|
||||
"sys_jemalloc_resident",
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// Copyright 2023 Greptime Team
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use std::any::Any;
|
||||
|
||||
use common_error::ext::{BoxedError, ErrorExt};
|
||||
use common_error::status_code::StatusCode;
|
||||
use common_macro::stack_trace_debug;
|
||||
use snafu::{Location, Snafu};
|
||||
|
||||
#[derive(Snafu)]
|
||||
#[snafu(visibility(pub))]
|
||||
#[stack_trace_debug]
|
||||
pub enum Error {
|
||||
#[snafu(display("Failed to update jemalloc metrics"))]
|
||||
UpdateJemallocMetrics {
|
||||
#[snafu(source)]
|
||||
error: tikv_jemalloc_ctl::Error,
|
||||
location: Location,
|
||||
},
|
||||
}
|
||||
|
||||
impl ErrorExt for Error {
|
||||
fn status_code(&self) -> StatusCode {
|
||||
match self {
|
||||
Error::UpdateJemallocMetrics { .. } => StatusCode::Internal,
|
||||
}
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Error> for crate::error::Error {
|
||||
fn from(e: Error) -> Self {
|
||||
Self::Metrics {
|
||||
source: BoxedError::new(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ pub type Result<T> = std::result::Result<T, Error>;
|
||||
#[snafu(visibility(pub))]
|
||||
#[stack_trace_debug]
|
||||
pub enum Error {
|
||||
#[snafu(display(""))]
|
||||
#[snafu(display("DataFusion error"))]
|
||||
Datafusion {
|
||||
#[snafu(source)]
|
||||
error: DataFusionError,
|
||||
|
||||
@@ -187,7 +187,7 @@ SELECT * FROM integers i1 WHERE NOT EXISTS(SELECT i FROM integers WHERE i=i1.i)
|
||||
|
||||
SELECT i1.i,i2.i FROM integers i1, integers i2 WHERE i1.i=(SELECT i FROM integers WHERE i1.i=i) AND i1.i=i2.i ORDER BY i1.i;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Error during planning: Correlated scalar subquery must be aggregated to return at most one row
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Error during planning: Correlated scalar subquery must be aggregated to return at most one row
|
||||
|
||||
SELECT * FROM (SELECT i1.i AS a, i2.i AS b FROM integers i1, integers i2) a1 WHERE a=b ORDER BY 1;
|
||||
|
||||
@@ -241,7 +241,7 @@ Error: 3001(EngineExecuteQuery), Invalid argument error: must either specify a r
|
||||
|
||||
SELECT * FROM (SELECT 0=1 AS cond FROM integers i1, integers i2 GROUP BY 1) a1 WHERE cond ORDER BY 1;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Error during planning: Attempted to create Filter predicate with expression `Boolean(false)` aliased as 'Int64(0) = Int64(1)'. Filter predicates should not be aliased.
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Error during planning: Attempted to create Filter predicate with expression `Boolean(false)` aliased as 'Int64(0) = Int64(1)'. Filter predicates should not be aliased.
|
||||
|
||||
DROP TABLE integers;
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@ SELECT DISTINCT i%2 FROM integers ORDER BY 1;
|
||||
-- +-----------------------+
|
||||
SELECT DISTINCT i % 2 FROM integers WHERE i<3 ORDER BY i;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: For SELECT DISTINCT, ORDER BY expressions i must appear in select list
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: For SELECT DISTINCT, ORDER BY expressions i must appear in select list
|
||||
|
||||
SELECT DISTINCT ON (1) i % 2, i FROM integers WHERE i<3 ORDER BY i;
|
||||
|
||||
Error: 3000(PlanQuery), This feature is not implemented: DISTINCT ON Exprs not supported
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: This feature is not implemented: DISTINCT ON Exprs not supported
|
||||
|
||||
SELECT DISTINCT integers.i FROM integers ORDER BY i DESC;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ Error: 4001(TableNotFound), Table not found: t
|
||||
|
||||
SELECT * FROM t;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Table not found: greptime.public.t
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Table not found: greptime.public.t
|
||||
|
||||
CREATE TABLE t(i INTEGER, j TIMESTAMP TIME INDEX);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ Error: 1001(Unsupported), SQL statement is not supported: DROP SCHEMA test_publi
|
||||
|
||||
SELECT * FROM test_public_schema.hello;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Table not found: greptime.test_public_schema.hello
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Table not found: greptime.test_public_schema.hello
|
||||
|
||||
USE public;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Affected Rows: 2
|
||||
|
||||
select * from system_Metric;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Table not found: greptime.upper_case_table_name.system_metric
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Table not found: greptime.upper_case_table_name.system_metric
|
||||
|
||||
select * from "system_Metric";
|
||||
|
||||
|
||||
@@ -57,12 +57,12 @@ with cte1 as (select i as j from a), cte2 as (select ref.j as k from cte1 as ref
|
||||
|
||||
with cte1 as (select 42), cte1 as (select 42) select * FROM cte1;
|
||||
|
||||
Error: 3000(PlanQuery), sql parser error: WITH query name "cte1" specified more than once
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: sql parser error: WITH query name "cte1" specified more than once
|
||||
|
||||
-- reference to CTE before its actually defined, it's not supported by datafusion
|
||||
with cte3 as (select ref2.j as i from cte1 as ref2), cte1 as (Select i as j from a), cte2 as (select ref.j+1 as k from cte1 as ref) select * from cte2 union all select * FROM cte3;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Table not found: greptime.public.cte1
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Table not found: greptime.public.cte1
|
||||
|
||||
with cte1 as (Select i as j from a) select * from cte1 cte11, cte1 cte12;
|
||||
|
||||
@@ -109,7 +109,7 @@ WITH RECURSIVE cte(d) AS (
|
||||
)
|
||||
SELECT max(d) FROM cte;
|
||||
|
||||
Error: 3000(PlanQuery), This feature is not implemented: Recursive CTEs are not supported
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: This feature is not implemented: Recursive CTEs are not supported
|
||||
|
||||
-- Nested aliases is not supported in datafusion
|
||||
with cte (a) as (
|
||||
@@ -121,7 +121,7 @@ select
|
||||
from cte
|
||||
where alias2 > 0;
|
||||
|
||||
Error: 3000(PlanQuery), No field named alias2. Valid fields are cte.a.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: No field named alias2. Valid fields are cte.a.
|
||||
|
||||
drop table a;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ with cte1 as (with b as (Select i as j from a) select j from b), cte2 as (with c
|
||||
|
||||
with cte1 as (select 42), cte1 as (select 42) select * FROM cte1;
|
||||
|
||||
Error: 3000(PlanQuery), sql parser error: WITH query name "cte1" specified more than once
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: sql parser error: WITH query name "cte1" specified more than once
|
||||
|
||||
with cte1 as (Select i as j from a) select * from (with cte2 as (select max(j) as j from cte1) select * from cte2) f;
|
||||
|
||||
@@ -64,12 +64,12 @@ with cte1 as (Select i as j from a) select * from cte1 where j = (with cte2 as (
|
||||
-- this feature is not implemented in datafusion
|
||||
with cte as (Select i as j from a) select * from cte where j = (with cte as (select max(j) as j from cte) select j from cte);
|
||||
|
||||
Error: 3000(PlanQuery), sql parser error: WITH query name "cte" specified more than once
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: sql parser error: WITH query name "cte" specified more than once
|
||||
|
||||
-- self-refer to non-existent cte-
|
||||
with cte as (select * from cte) select * from cte;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Table not found: greptime.public.cte
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Table not found: greptime.public.cte
|
||||
|
||||
drop table a;
|
||||
|
||||
|
||||
@@ -12,15 +12,15 @@ Affected Rows: 2
|
||||
|
||||
insert into demo2(host) select * from demo1;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Column count doesn't match insert query!
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Column count doesn't match insert query!
|
||||
|
||||
insert into demo2 select cpu,memory from demo1;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Column count doesn't match insert query!
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Column count doesn't match insert query!
|
||||
|
||||
insert into demo2(ts) select memory from demo1;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Cannot automatically convert Float64 to Timestamp(Millisecond, None)
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Cannot automatically convert Float64 to Timestamp(Millisecond, None)
|
||||
|
||||
insert into demo2 select * from demo1;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ select * from data;
|
||||
|
||||
insert into data values (4, 'infinityyyy'::double);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast string 'infinityyyy' to value of Float64 type
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast string 'infinityyyy' to value of Float64 type
|
||||
|
||||
drop table data;
|
||||
|
||||
|
||||
@@ -16,27 +16,27 @@ SELECT a FROM test LIMIT 1;
|
||||
|
||||
SELECT a FROM test LIMIT 1.25;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT a FROM test LIMIT 2-1;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT a FROM test LIMIT a;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT a FROM test LIMIT a+1;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT a FROM test LIMIT SUM(42);
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT a FROM test LIMIT row_number() OVER ();
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
CREATE TABLE test2 (a STRING, ts TIMESTAMP TIME INDEX);
|
||||
|
||||
@@ -56,7 +56,7 @@ SELECT * FROM test2 LIMIT 3;
|
||||
|
||||
select 1 limit date '1992-01-01';
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
CREATE TABLE integers(i TIMESTAMP TIME INDEX);
|
||||
|
||||
@@ -89,35 +89,35 @@ SELECT * FROM integers LIMIT 4;
|
||||
|
||||
SELECT * FROM integers as int LIMIT (SELECT MIN(integers.i) FROM integers);
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT * FROM integers as int OFFSET (SELECT MIN(integers.i) FROM integers);
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Unexpected expression in OFFSET clause
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Unexpected expression in OFFSET clause
|
||||
|
||||
SELECT * FROM integers as int LIMIT (SELECT MAX(integers.i) FROM integers) OFFSET (SELECT MIN(integers.i) FROM integers);
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Unexpected expression in OFFSET clause
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Unexpected expression in OFFSET clause
|
||||
|
||||
SELECT * FROM integers as int LIMIT (SELECT max(integers.i) FROM integers where i > 5);
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT * FROM integers as int LIMIT (SELECT max(integers.i) FROM integers where i > 5);
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT * FROM integers as int LIMIT (SELECT NULL);
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT * FROM integers as int LIMIT (SELECT -1);
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
SELECT * FROM integers as int LIMIT (SELECT 'ab');
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: LIMIT must not be negative
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: LIMIT must not be negative
|
||||
|
||||
DROP TABLE integers;
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ SELECT a-10 AS k FROM test UNION SELECT a-10 AS l FROM test ORDER BY k;
|
||||
-- CONTROVERSIAL: SQLite allows both "k" and "l" to be referenced here, Postgres and MonetDB give an error.
|
||||
SELECT a-10 AS k FROM test UNION SELECT a-10 AS l FROM test ORDER BY l;
|
||||
|
||||
Error: 3000(PlanQuery), No field named l. Valid fields are k.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: No field named l. Valid fields are k.
|
||||
|
||||
-- Not compatible with duckdb, work in gretimedb
|
||||
SELECT a-10 AS k FROM test UNION SELECT a-10 AS l FROM test ORDER BY 1-k;
|
||||
@@ -215,7 +215,7 @@ SELECT a-10 AS k FROM test UNION SELECT a-10 AS l FROM test ORDER BY 1-k;
|
||||
-- Error: 3000(PlanQuery), Schema error: No field named 'a'. Valid fields are 'k'.
|
||||
SELECT a-10 AS k FROM test UNION SELECT a-10 AS l FROM test ORDER BY a-10;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: For SELECT DISTINCT, ORDER BY expressions a must appear in select list
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: For SELECT DISTINCT, ORDER BY expressions a must appear in select list
|
||||
|
||||
-- Not compatible with duckdb, give an error in greptimedb
|
||||
-- TODO(LFC): Failed to meet the expected error:
|
||||
@@ -223,7 +223,7 @@ Error: 3000(PlanQuery), Error during planning: For SELECT DISTINCT, ORDER BY exp
|
||||
-- Error: 3000(PlanQuery), Schema error: No field named 'a'. Valid fields are 'k'.
|
||||
SELECT a-10 AS k FROM test UNION SELECT a-11 AS l FROM test ORDER BY a-11;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: For SELECT DISTINCT, ORDER BY expressions a must appear in select list
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: For SELECT DISTINCT, ORDER BY expressions a must appear in select list
|
||||
|
||||
DROP TABLE test;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Affected Rows: 3
|
||||
|
||||
SELECT a FROM test ORDER BY 2;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Order by column out of bounds, specified: 2, max: 1
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Order by column out of bounds, specified: 2, max: 1
|
||||
|
||||
-- Not work in greptimedb
|
||||
SELECT a FROM test ORDER BY 'hello', a;
|
||||
@@ -38,7 +38,7 @@ SELECT a AS k, b FROM test UNION SELECT a AS k, b FROM test ORDER BY k;
|
||||
|
||||
SELECT a % 2, b FROM test UNION SELECT b, a % 2 AS k ORDER BY a % 2;
|
||||
|
||||
Error: 3000(PlanQuery), No field named b.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: No field named b.
|
||||
|
||||
-- Works duckdb, but not work in greptimedb
|
||||
-- TODO(LFC): Failed to meet the expected error:
|
||||
@@ -46,11 +46,11 @@ Error: 3000(PlanQuery), No field named b.
|
||||
-- Error: 3000(PlanQuery), Schema error: No field named 'a'. Valid fields are 'test.a % Int64(2)', 'b'.
|
||||
SELECT a % 2, b FROM test UNION SELECT a % 2 AS k, b FROM test ORDER BY a % 2;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: For SELECT DISTINCT, ORDER BY expressions a must appear in select list
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: For SELECT DISTINCT, ORDER BY expressions a must appear in select list
|
||||
|
||||
SELECT a % 2, b FROM test UNION SELECT a % 2 AS k, b FROM test ORDER BY 3;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Order by column out of bounds, specified: 3, max: 2
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Order by column out of bounds, specified: 3, max: 2
|
||||
|
||||
SELECT a % 2, b FROM test UNION SELECT a % 2 AS k, b FROM test ORDER BY -1;
|
||||
|
||||
@@ -58,7 +58,7 @@ Error: 3001(EngineExecuteQuery), Error during planning: Sort operation is not ap
|
||||
|
||||
SELECT a % 2, b FROM test UNION SELECT a % 2 AS k FROM test ORDER BY -1;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Union queries must have the same number of columns, (left is 2, right is 1)
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Union queries must have the same number of columns, (left is 2, right is 1)
|
||||
|
||||
DROP TABLE test;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ SELECT ts, CAST(length(host) as INT64) + 2, max(val) RANGE '5s' FROM host ALIGN
|
||||
-- project non-aggregation key
|
||||
SELECT ts, host, max(val) RANGE '5s' FROM host ALIGN '20s' BY () ORDER BY ts;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), No field named host.host. Valid fields are "MAX(host.val) RANGE 5s FILL NULL", host.ts, "Int64(1)".
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: No field named host.host. Valid fields are "MAX(host.val) RANGE 5s FILL NULL", host.ts, "Int64(1)".
|
||||
|
||||
DROP TABLE host;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ Error: 2000(InvalidSyntax), sql parser error: Illegal Range select, no RANGE key
|
||||
|
||||
SELECT min(val) RANGE '10s', max(val) FROM host ALIGN '5s';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), No field named "MAX(host.val)". Valid fields are "MIN(host.val) RANGE 10s FILL NULL", host.ts, host.host.
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: No field named "MAX(host.val)". Valid fields are "MIN(host.val) RANGE 10s FILL NULL", host.ts, host.host.
|
||||
|
||||
SELECT min(val) * 2 RANGE '10s' FROM host ALIGN '5s';
|
||||
|
||||
@@ -54,7 +54,7 @@ Error: 2000(InvalidSyntax), sql parser error: Can't use the RANGE keyword in Exp
|
||||
-- 2.2 no align param
|
||||
SELECT min(val) RANGE '5s' FROM host;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Missing argument in range select query
|
||||
Error: 3000(PlanQuery), DataFusion error: Error during planning: Missing argument in range select query
|
||||
|
||||
-- 2.3 type mismatch
|
||||
SELECT covar(ceil(val), floor(val)) RANGE '20s' FROM host ALIGN '10s';
|
||||
@@ -75,11 +75,11 @@ Error: 2000(InvalidSyntax), Range Query: Window functions is not allowed in Rang
|
||||
-- 2.6 invalid fill
|
||||
SELECT min(val) RANGE '5s', min(val) RANGE '5s' FILL NULL FROM host ALIGN '5s';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Schema contains duplicate unqualified field name "MIN(host.val) RANGE 5s FILL NULL"
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Schema contains duplicate unqualified field name "MIN(host.val) RANGE 5s FILL NULL"
|
||||
|
||||
SELECT min(val) RANGE '5s' FROM host ALIGN '5s' FILL 3.0;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: 3.0 is not a valid fill option, fail to convert to a const value. { Arrow error: Cast error: Cannot cast string '3.0' to value of Int64 type }
|
||||
Error: 3000(PlanQuery), DataFusion error: Error during planning: 3.0 is not a valid fill option, fail to convert to a const value. { Arrow error: Cast error: Cannot cast string '3.0' to value of Int64 type }
|
||||
|
||||
DROP TABLE host;
|
||||
|
||||
|
||||
@@ -24,15 +24,15 @@ select 4 + 0.5;
|
||||
|
||||
select "a";
|
||||
|
||||
Error: 3000(PlanQuery), No field named a.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: No field named a.
|
||||
|
||||
select "A";
|
||||
|
||||
Error: 3000(PlanQuery), No field named "A".
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: No field named "A".
|
||||
|
||||
select * where "a" = "A";
|
||||
|
||||
Error: 3000(PlanQuery), No field named a.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: No field named a.
|
||||
|
||||
select TO_UNIXTIME('2023-03-01T06:35:02Z');
|
||||
|
||||
|
||||
@@ -11,23 +11,23 @@ SELECT 'nan'::FLOAT;
|
||||
-- cannot cast nan, inf or -inf to these types
|
||||
SELECT 'nan'::FLOAT::INT;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Can't cast value NaN to type Int32
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Can't cast value NaN to type Int32
|
||||
|
||||
SELECT 'nan'::FLOAT::DECIMAL(4,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(4, 1). Overflowing on NaN
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(4, 1). Overflowing on NaN
|
||||
|
||||
SELECT 'nan'::FLOAT::DECIMAL(9,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(9, 1). Overflowing on NaN
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(9, 1). Overflowing on NaN
|
||||
|
||||
SELECT 'nan'::FLOAT::DECIMAL(18,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(18, 1). Overflowing on NaN
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(18, 1). Overflowing on NaN
|
||||
|
||||
SELECT 'nan'::FLOAT::DECIMAL(38,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(38, 1). Overflowing on NaN
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(38, 1). Overflowing on NaN
|
||||
|
||||
SELECT 'inf'::FLOAT;
|
||||
|
||||
@@ -40,23 +40,23 @@ SELECT 'inf'::FLOAT;
|
||||
-- cannot cast nan, inf or -inf to these types
|
||||
SELECT 'inf'::FLOAT::INT;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Can't cast value inf to type Int32
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Can't cast value inf to type Int32
|
||||
|
||||
SELECT 'inf'::FLOAT::DECIMAL(4,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(4, 1). Overflowing on inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(4, 1). Overflowing on inf
|
||||
|
||||
SELECT 'inf'::FLOAT::DECIMAL(9,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(9, 1). Overflowing on inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(9, 1). Overflowing on inf
|
||||
|
||||
SELECT 'inf'::FLOAT::DECIMAL(18,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(18, 1). Overflowing on inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(18, 1). Overflowing on inf
|
||||
|
||||
SELECT 'inf'::FLOAT::DECIMAL(38,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(38, 1). Overflowing on inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(38, 1). Overflowing on inf
|
||||
|
||||
SELECT '-inf'::FLOAT;
|
||||
|
||||
@@ -69,23 +69,23 @@ SELECT '-inf'::FLOAT;
|
||||
-- cannot cast nan, inf or -inf to these types
|
||||
SELECT '-inf'::FLOAT::INT;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Can't cast value -inf to type Int32
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Can't cast value -inf to type Int32
|
||||
|
||||
SELECT '-inf'::FLOAT::DECIMAL(4,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(4, 1). Overflowing on -inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(4, 1). Overflowing on -inf
|
||||
|
||||
SELECT '-inf'::FLOAT::DECIMAL(9,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(9, 1). Overflowing on -inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(9, 1). Overflowing on -inf
|
||||
|
||||
SELECT '-inf'::FLOAT::DECIMAL(18,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(18, 1). Overflowing on -inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(18, 1). Overflowing on -inf
|
||||
|
||||
SELECT '-inf'::FLOAT::DECIMAL(38,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(38, 1). Overflowing on -inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(38, 1). Overflowing on -inf
|
||||
|
||||
SELECT 'nan'::DOUBLE;
|
||||
|
||||
@@ -98,23 +98,23 @@ SELECT 'nan'::DOUBLE;
|
||||
-- cannot cast nan, inf or -inf to these types
|
||||
SELECT 'nan'::DOUBLE::INT;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Can't cast value NaN to type Int32
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Can't cast value NaN to type Int32
|
||||
|
||||
SELECT 'nan'::DOUBLE::DECIMAL(4,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(4, 1). Overflowing on NaN
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(4, 1). Overflowing on NaN
|
||||
|
||||
SELECT 'nan'::DOUBLE::DECIMAL(9,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(9, 1). Overflowing on NaN
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(9, 1). Overflowing on NaN
|
||||
|
||||
SELECT 'nan'::DOUBLE::DECIMAL(18,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(18, 1). Overflowing on NaN
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(18, 1). Overflowing on NaN
|
||||
|
||||
SELECT 'nan'::DOUBLE::DECIMAL(38,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(38, 1). Overflowing on NaN
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(38, 1). Overflowing on NaN
|
||||
|
||||
SELECT 'inf'::DOUBLE;
|
||||
|
||||
@@ -127,23 +127,23 @@ SELECT 'inf'::DOUBLE;
|
||||
-- cannot cast nan, inf or -inf to these types
|
||||
SELECT 'inf'::DOUBLE::INT;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Can't cast value inf to type Int32
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Can't cast value inf to type Int32
|
||||
|
||||
SELECT 'inf'::DOUBLE::DECIMAL(4,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(4, 1). Overflowing on inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(4, 1). Overflowing on inf
|
||||
|
||||
SELECT 'inf'::DOUBLE::DECIMAL(9,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(9, 1). Overflowing on inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(9, 1). Overflowing on inf
|
||||
|
||||
SELECT 'inf'::DOUBLE::DECIMAL(18,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(18, 1). Overflowing on inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(18, 1). Overflowing on inf
|
||||
|
||||
SELECT 'inf'::DOUBLE::DECIMAL(38,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(38, 1). Overflowing on inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(38, 1). Overflowing on inf
|
||||
|
||||
SELECT '-inf'::DOUBLE;
|
||||
|
||||
@@ -156,23 +156,23 @@ SELECT '-inf'::DOUBLE;
|
||||
-- cannot cast nan, inf or -inf to these types
|
||||
SELECT '-inf'::DOUBLE::INT;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Can't cast value -inf to type Int32
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Can't cast value -inf to type Int32
|
||||
|
||||
SELECT '-inf'::DOUBLE::DECIMAL(4,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(4, 1). Overflowing on -inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(4, 1). Overflowing on -inf
|
||||
|
||||
SELECT '-inf'::DOUBLE::DECIMAL(9,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(9, 1). Overflowing on -inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(9, 1). Overflowing on -inf
|
||||
|
||||
SELECT '-inf'::DOUBLE::DECIMAL(18,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(18, 1). Overflowing on -inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(18, 1). Overflowing on -inf
|
||||
|
||||
SELECT '-inf'::DOUBLE::DECIMAL(38,1);
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Cast error: Cannot cast to Decimal128(38, 1). Overflowing on -inf
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Cannot cast to Decimal128(38, 1). Overflowing on -inf
|
||||
|
||||
-- we can cast nan, inf and -inf between floats and doubles, as well as to/from strings
|
||||
SELECT 'nan'::FLOAT::VARCHAR;
|
||||
|
||||
@@ -41,15 +41,15 @@ SELECT INTERVAL '1 year 2 months 3 days 4 hours' - INTERVAL '1 year';
|
||||
|
||||
SELECT INTERVAL '6 years' * 2;
|
||||
|
||||
Error: 3000(PlanQuery), This feature is not implemented: Unsupported interval operator: Multiply
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: This feature is not implemented: Unsupported interval operator: Multiply
|
||||
|
||||
SELECT INTERVAL '6 years' / 2;
|
||||
|
||||
Error: 3000(PlanQuery), This feature is not implemented: Unsupported interval operator: Divide
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: This feature is not implemented: Unsupported interval operator: Divide
|
||||
|
||||
SELECT INTERVAL '6 years' = INTERVAL '72 months';
|
||||
|
||||
Error: 3000(PlanQuery), This feature is not implemented: Unsupported interval operator: Eq
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: This feature is not implemented: Unsupported interval operator: Eq
|
||||
|
||||
SELECT arrow_typeof(INTERVAL '1 month');
|
||||
|
||||
@@ -62,7 +62,7 @@ SELECT arrow_typeof(INTERVAL '1 month');
|
||||
-- INTERVAL + TIME CONSTANT
|
||||
SELECT current_time() + INTERVAL '1 hour';
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Cannot coerce arithmetic expression Time64(Nanosecond) + Interval(MonthDayNano) to valid types
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Cannot coerce arithmetic expression Time64(Nanosecond) + Interval(MonthDayNano) to valid types
|
||||
|
||||
-- table with interval type test
|
||||
CREATE TABLE IF NOT EXISTS intervals(
|
||||
@@ -259,13 +259,13 @@ This was likely caused by a bug in DataFusion's code and we would welcome that y
|
||||
|
||||
SELECT SUM(interval_value) from intervals;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: No function matches the given name and argument types 'SUM(Interval(MonthDayNano))'. You might need to add explicit type casts.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: No function matches the given name and argument types 'SUM(Interval(MonthDayNano))'. You might need to add explicit type casts.
|
||||
Candidate functions:
|
||||
SUM(Int8/Int16/Int32/Int64/UInt8/UInt16/UInt32/UInt64/Float32/Float64)
|
||||
|
||||
SELECT AVG(interval_value) from intervals;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: No function matches the given name and argument types 'AVG(Interval(MonthDayNano))'. You might need to add explicit type casts.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: No function matches the given name and argument types 'AVG(Interval(MonthDayNano))'. You might need to add explicit type casts.
|
||||
Candidate functions:
|
||||
AVG(Int8/Int16/Int32/Int64/UInt8/UInt16/UInt32/UInt64/Float32/Float64)
|
||||
|
||||
|
||||
@@ -32,15 +32,15 @@ SELECT timestamp ' 2017-07-23 13:10:11 ';
|
||||
|
||||
SELECT timestamp ' 2017-07-23 13:10:11 AA';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Invalid timezone "AA": 'AA' is not a valid timezone
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Invalid timezone "AA": 'AA' is not a valid timezone
|
||||
|
||||
SELECT timestamp 'AA2017-07-23 13:10:11';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from 'AA2017-07-23 13:10:11': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from 'AA2017-07-23 13:10:11': error parsing date
|
||||
|
||||
SELECT timestamp '2017-07-23A13:10:11';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '2017-07-23A13:10:11': invalid timestamp separator
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '2017-07-23A13:10:11': invalid timestamp separator
|
||||
|
||||
SELECT t FROM timestamp ORDER BY t;
|
||||
|
||||
@@ -75,31 +75,31 @@ SELECT MAX(t) FROM timestamp;
|
||||
|
||||
SELECT SUM(t) FROM timestamp;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: No function matches the given name and argument types 'SUM(Timestamp(Millisecond, None))'. You might need to add explicit type casts.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: No function matches the given name and argument types 'SUM(Timestamp(Millisecond, None))'. You might need to add explicit type casts.
|
||||
Candidate functions:
|
||||
SUM(Int8/Int16/Int32/Int64/UInt8/UInt16/UInt32/UInt64/Float32/Float64)
|
||||
|
||||
SELECT AVG(t) FROM timestamp;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: No function matches the given name and argument types 'AVG(Timestamp(Millisecond, None))'. You might need to add explicit type casts.
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: No function matches the given name and argument types 'AVG(Timestamp(Millisecond, None))'. You might need to add explicit type casts.
|
||||
Candidate functions:
|
||||
AVG(Int8/Int16/Int32/Int64/UInt8/UInt16/UInt32/UInt64/Float32/Float64)
|
||||
|
||||
SELECT t+t FROM timestamp;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Cannot get result type for temporal operation Timestamp(Millisecond, None) + Timestamp(Millisecond, None): Invalid argument error: Invalid timestamp arithmetic operation: Timestamp(Millisecond, None) + Timestamp(Millisecond, None)
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Cannot get result type for temporal operation Timestamp(Millisecond, None) + Timestamp(Millisecond, None): Invalid argument error: Invalid timestamp arithmetic operation: Timestamp(Millisecond, None) + Timestamp(Millisecond, None)
|
||||
|
||||
SELECT t*t FROM timestamp;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Cannot get result type for temporal operation Timestamp(Millisecond, None) * Timestamp(Millisecond, None): Invalid argument error: Invalid timestamp arithmetic operation: Timestamp(Millisecond, None) * Timestamp(Millisecond, None)
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Cannot get result type for temporal operation Timestamp(Millisecond, None) * Timestamp(Millisecond, None): Invalid argument error: Invalid timestamp arithmetic operation: Timestamp(Millisecond, None) * Timestamp(Millisecond, None)
|
||||
|
||||
SELECT t/t FROM timestamp;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Cannot get result type for temporal operation Timestamp(Millisecond, None) / Timestamp(Millisecond, None): Invalid argument error: Invalid timestamp arithmetic operation: Timestamp(Millisecond, None) / Timestamp(Millisecond, None)
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Cannot get result type for temporal operation Timestamp(Millisecond, None) / Timestamp(Millisecond, None): Invalid argument error: Invalid timestamp arithmetic operation: Timestamp(Millisecond, None) / Timestamp(Millisecond, None)
|
||||
|
||||
SELECT t%t FROM timestamp;
|
||||
|
||||
Error: 3000(PlanQuery), Error during planning: Cannot get result type for temporal operation Timestamp(Millisecond, None) % Timestamp(Millisecond, None): Invalid argument error: Invalid timestamp arithmetic operation: Timestamp(Millisecond, None) % Timestamp(Millisecond, None)
|
||||
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Cannot get result type for temporal operation Timestamp(Millisecond, None) % Timestamp(Millisecond, None): Invalid argument error: Invalid timestamp arithmetic operation: Timestamp(Millisecond, None) % Timestamp(Millisecond, None)
|
||||
|
||||
-- TODO(dennis): It can't run on distributed mode, uncomment it when the issue is fixed: https://github.com/GreptimeTeam/greptimedb/issues/2071 --
|
||||
-- SELECT t-t FROM timestamp; --
|
||||
@@ -169,11 +169,11 @@ SELECT TIMESTAMP '2008-01-01 00:00:01.5'::VARCHAR;
|
||||
|
||||
SELECT TIMESTAMP '-8-01-01 00:00:01.5'::VARCHAR;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '-8-01-01 00:00:01.5': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '-8-01-01 00:00:01.5': error parsing date
|
||||
|
||||
SELECT TIMESTAMP '100000-01-01 00:00:01.5'::VARCHAR;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '100000-01-01 00:00:01.5': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '100000-01-01 00:00:01.5': error parsing date
|
||||
|
||||
DROP TABLE timestamp;
|
||||
|
||||
|
||||
@@ -9,73 +9,73 @@ select timestamp '1970-01-01';
|
||||
|
||||
select '290309-12-22 (BC) 00:00:00'::timestamp;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
|
||||
select '290309-12-21 (BC) 12:59:59.999999'::timestamp;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-21 (BC) 12:59:59.999999': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-21 (BC) 12:59:59.999999': error parsing date
|
||||
|
||||
select '290309-12-22 (BC) 00:00:00'::timestamp + interval '1 day';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
|
||||
select '290309-12-22 (BC) 00:00:00'::timestamp - interval '1 microsecond';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
|
||||
select '290309-12-22 (BC) 00:00:00'::timestamp - interval '1 second';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
|
||||
select '290309-12-22 (BC) 00:00:00'::timestamp - interval '1 day';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
|
||||
select '290309-12-22 (BC) 00:00:00'::timestamp - interval '1 month';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
|
||||
select '290309-12-22 (BC) 00:00:00'::timestamp - interval '1 year';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00': error parsing date
|
||||
|
||||
select timestamp '294247-01-10 04:00:54.775806';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
|
||||
select timestamp '294247-01-10 04:00:54.775807';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775807': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775807': error parsing date
|
||||
|
||||
select timestamp '294247-01-10 04:00:54.775806' + interval '1 microsecond';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
|
||||
select timestamp '294247-01-10 04:00:54.775806' + interval '1 second';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
|
||||
select timestamp '294247-01-10 04:00:54.775806' + interval '1 hour';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
|
||||
select timestamp '294247-01-10 04:00:54.775806' + interval '1 day';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
|
||||
select timestamp '294247-01-10 04:00:54.775806' + interval '1 month';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
|
||||
select timestamp '294247-01-10 04:00:54.775806' + interval '1 year';
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54.775806': error parsing date
|
||||
|
||||
SELECT '290309-12-22 (BC) 00:00:00+07:00'::TIMESTAMP;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00+07:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '290309-12-22 (BC) 00:00:00+07:00': error parsing date
|
||||
|
||||
SELECT '294247-01-10 04:00:54-07:00'::TIMESTAMP;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '294247-01-10 04:00:54-07:00': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '294247-01-10 04:00:54-07:00': error parsing date
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ Affected Rows: 1
|
||||
|
||||
select '90000-01-19 03:14:07.999999'::TIMESTAMP_US::TIMESTAMP_NS;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Parser error: Error parsing timestamp from '90000-01-19 03:14:07.999999': error parsing date
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Parser error: Error parsing timestamp from '90000-01-19 03:14:07.999999': error parsing date
|
||||
|
||||
select sec::DATE from timestamp;
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ SELECT * FROM integers i1 WHERE NOT EXISTS(SELECT i FROM integers WHERE i=i1.i)
|
||||
|
||||
SELECT i1.i,i2.i FROM integers i1, integers i2 WHERE i1.i=(SELECT i FROM integers WHERE i1.i=i) AND i1.i=i2.i ORDER BY i1.i;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Error during planning: Correlated scalar subquery must be aggregated to return at most one row
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Error during planning: Correlated scalar subquery must be aggregated to return at most one row
|
||||
|
||||
SELECT * FROM (SELECT i1.i AS a, i2.i AS b FROM integers i1, integers i2) a1 WHERE a=b ORDER BY 1;
|
||||
|
||||
@@ -192,7 +192,7 @@ SELECT i FROM (SELECT * FROM integers i1 UNION SELECT * FROM integers i2) a WHER
|
||||
-- SELECT * FROM (SELECT 0=1 AS cond FROM integers i1, integers i2) a1 WHERE cond ORDER BY 1;
|
||||
SELECT * FROM (SELECT 0=1 AS cond FROM integers i1, integers i2 GROUP BY 1) a1 WHERE cond ORDER BY 1;
|
||||
|
||||
Error: 3001(EngineExecuteQuery), Error during planning: Attempted to create Filter predicate with expression `Boolean(false)` aliased as 'Int64(0) = Int64(1)'. Filter predicates should not be aliased.
|
||||
Error: 3001(EngineExecuteQuery), DataFusion error: Error during planning: Attempted to create Filter predicate with expression `Boolean(false)` aliased as 'Int64(0) = Int64(1)'. Filter predicates should not be aliased.
|
||||
|
||||
DROP TABLE integers;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user