mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-17 10:42:55 +00:00
* chore: update datafusion family Signed-off-by: luofucong <luofc@foxmail.com> * fix ci Signed-off-by: luofucong <luofc@foxmail.com> * use official otel-arrow-rust Signed-off-by: luofucong <luofc@foxmail.com> * rebase Signed-off-by: luofucong <luofc@foxmail.com> * use the official orc-rust Signed-off-by: luofucong <luofc@foxmail.com> * resolve PR comments Signed-off-by: luofucong <luofc@foxmail.com> * remove the empty lines Signed-off-by: luofucong <luofc@foxmail.com> * try following PR comments Signed-off-by: luofucong <luofc@foxmail.com> --------- Signed-off-by: luofucong <luofc@foxmail.com>
158 lines
5.8 KiB
Plaintext
158 lines
5.8 KiB
Plaintext
CREATE TABLE integers(i INTEGER, j TIMESTAMP TIME INDEX);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT * FROM integers WHERE i IN ((SELECT i FROM integers)) ORDER BY i;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: integers.i ASC NULLS LAST_|
|
|
|_|_LeftSemi Join: integers.i = __correlated_sq_1.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| TableScan: integers_|
|
|
|_| ]]_|
|
|
|_|_SubqueryAlias: __correlated_sq_1_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Projection: integers.i_|
|
|
|_|_TableScan: integers_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [i@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[i@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_CoalesceBatchesExec: target_batch_size=8192_|
|
|
|_|_REDACTED
|
|
|_|_CoalesceBatchesExec: target_batch_size=8192_|
|
|
|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_CooperativeExec_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_CoalesceBatchesExec: target_batch_size=8192_|
|
|
|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_CooperativeExec_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT i FROM integers WHERE i=i1.i) ORDER BY i1.i;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: i1.i ASC NULLS LAST_|
|
|
|_|_LeftSemi Join: i1.i = __correlated_sq_1.i_|
|
|
|_|_SubqueryAlias: i1_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| TableScan: integers_|
|
|
|_| ]]_|
|
|
|_|_SubqueryAlias: __correlated_sq_1_|
|
|
|_|_Projection: integers.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| TableScan: integers_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [i@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[i@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_CoalesceBatchesExec: target_batch_size=8192_|
|
|
|_|_REDACTED
|
|
|_|_CoalesceBatchesExec: target_batch_size=8192_|
|
|
|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_CooperativeExec_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_CoalesceBatchesExec: target_batch_size=8192_|
|
|
|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_ProjectionExec: expr=[i@0 as i]_|
|
|
|_|_CooperativeExec_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
create table other (i INTEGER, j TIMESTAMP TIME INDEX);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
explain select t.i
|
|
from (
|
|
select * from integers join other on 1=1
|
|
) t
|
|
where t.i is not null
|
|
order by t.i desc;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: t.i DESC NULLS FIRST_|
|
|
|_|_SubqueryAlias: t_|
|
|
|_|_Cross Join:_|
|
|
|_|_Filter: integers.i IS NOT NULL_|
|
|
|_|_Projection: integers.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| TableScan: integers_|
|
|
|_| ]]_|
|
|
|_|_Projection:_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| TableScan: other_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [i@0 DESC]_|
|
|
|_|_SortExec: expr=[i@0 DESC], preserve_partitioning=[true]_|
|
|
|_|_CrossJoinExec_|
|
|
|_|_CoalescePartitionsExec_|
|
|
|_|_CoalesceBatchesExec: target_batch_size=8192_|
|
|
|_|_FilterExec: i@0 IS NOT NULL_|
|
|
|_|_ProjectionExec: expr=[i@0 as i]_|
|
|
|_|_CooperativeExec_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_ProjectionExec: expr=[]_|
|
|
|_|_CooperativeExec_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
INSERT INTO other SELECT i, 2 FROM integers WHERE i=(SELECT MAX(i) FROM integers);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- Explain physical plan for DML is not supported because it looks up the table name in a way that is
|
|
-- different from normal queries. It also requires the table provider to implement the `insert_into()` method.
|
|
EXPLAIN INSERT INTO other SELECT i, 2 FROM integers WHERE i=(SELECT MAX(i) FROM integers);
|
|
|
|
+---------------------+-----------------------------------------------------------------------------+
|
|
| plan_type | plan |
|
|
+---------------------+-----------------------------------------------------------------------------+
|
|
| logical_plan | Dml: op=[Insert Into] table=[other] |
|
|
| | Projection: integers.i AS i, TimestampMillisecond(2, None) AS j |
|
|
| | Inner Join: integers.i = __scalar_sq_1.max(integers.i) |
|
|
| | Projection: integers.i |
|
|
| | MergeScan [is_placeholder=false, remote_input=[ |
|
|
| | TableScan: integers |
|
|
| | ]] |
|
|
| | SubqueryAlias: __scalar_sq_1 |
|
|
| | MergeScan [is_placeholder=false, remote_input=[ |
|
|
| | Projection: max(integers.i) |
|
|
| | Aggregate: groupBy=[[]], aggr=[[max(integers.i)]] |
|
|
| | TableScan: integers |
|
|
| | ]] |
|
|
| physical_plan_error | This feature is not implemented: Insert into not implemented for this table |
|
|
+---------------------+-----------------------------------------------------------------------------+
|
|
|
|
drop table other;
|
|
|
|
Affected Rows: 0
|
|
|
|
drop table integers;
|
|
|
|
Affected Rows: 0
|
|
|