xx789633 commented on PR #1924:
URL: https://github.com/apache/fluss/pull/1924#issuecomment-3514678046

   This SQL in Iceberg tab
   ```sql
   -- insert tuples into datalake_enriched_orders
   INSERT INTO datalake_enriched_orders
   SELECT o.order_key,
          o.cust_key,
          o.total_price,
          o.order_date,
          o.order_priority,
          o.clerk,
          c.name,
          c.phone,
          c.acctbal,
          c.mktsegment,
          n.name
   FROM fluss_order o
   LEFT JOIN fluss_customer FOR SYSTEM_TIME AS OF `o`.`ptime` AS `c`
       ON o.cust_key = c.cust_key
   LEFT JOIN fluss_nation FOR SYSTEM_TIME AS OF `o`.`ptime` AS `n`
       ON c.nation_key = n.nation_key;
   ```
   needs to be changed to:
   ```sql
   -- insert tuples into datalake_enriched_orders
   INSERT INTO datalake_enriched_orders
   SELECT o.order_key,
          o.cust_key,
          o.total_price,
          o.order_date,
          o.order_priority,
          o.clerk,
          c.name,
          c.phone,
          c.acctbal,
          c.mktsegment,
          n.name
   FROM (
       SELECT *, PROCTIME() as ptime
       FROM `default_catalog`.`default_database`.source_order
   ) o
   LEFT JOIN fluss_customer FOR SYSTEM_TIME AS OF o.ptime AS c
       ON o.cust_key = c.cust_key
   LEFT JOIN fluss_nation FOR SYSTEM_TIME AS OF o.ptime AS n
       ON c.nation_key = n.nation_key;
   ```
   I have created a pull request to fix that 
:https://github.com/apache/fluss/pull/1964
   
   Other than that, everything works as expected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to