Coder Social home page Coder Social logo

Comments (2)

st1page avatar st1page commented on September 26, 2024

change it to table, the bug will not happen

CREATE TABLE test_last_ingestion_time(
  source varchar,
  last_ingestion_time timestamp,
);

CREATE TABLE test_records(
  id int,
  record_timestamp timestamp,
);

insert into test_last_ingestion_time 
  select 'table_a' as source, TO_TIMESTAMP('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') as last_ingestion_time
  union all
  select 'table_b' as source, TO_TIMESTAMP('2024-01-01 00:00:01', 'YYYY-MM-DD HH24:MI:SS') as last_ingestion_time; 

insert into test_records
  select 1 as id, TO_TIMESTAMP('2024-01-01 00:00:01', 'YYYY-MM-DD HH24:MI:SS') as record_timestamp
  union all
  select 2 as id, TO_TIMESTAMP('2024-01-01 00:00:02', 'YYYY-MM-DD HH24:MI:SS') as record_timestamp

from risingwave.

st1page avatar st1page commented on September 26, 2024
dev=> explain (distsql, verbose) create materialized view if not exists "test_last_ingestion_time" as (
select 'table_a' as source, TO_TIMESTAMP('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') as last_ingestion_time
union all
select 'table_b' as source, TO_TIMESTAMP('2024-01-01 00:00:01', 'YYYY-MM-DD HH24:MI:SS') as last_ingestion_time
);
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`.

                                                                                QUERY PLAN                                                                                 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Fragment 0
 StreamMaterialize { columns: [source, last_ingestion_time, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck }
 ├── tables: [ Materialize: 4294967294 ]
 ├── output: [ 'table_a':Varchar, $expr10001, _row_id ]
 ├── stream key: [ _row_id ]
 └── StreamValues { rows: [['table_a':Varchar, '2024-01-01 00:00:00+00:00':Timestamptz, 0:Int64], ['table_b':Varchar, '2024-01-01 00:00:01+00:00':Timestamptz, 1:Int64]] }
     ├── output: [ 'table_a':Varchar, $expr10001, _row_id ]
     └── stream key: [ _row_id ]
 
 Table 4294967294
 ├── columns: [ source: character varying, last_ingestion_time: timestamp with time zone, _row_id: bigint ]
 ├── primary key: [ $2 ASC ]
 ├── value indices: [ 0, 1, 2 ]
 ├── distribution key: []
 └── read pk prefix len hint: 1

from risingwave.

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.