seekforshell opened a new issue, #8633:
URL: https://github.com/apache/paimon/issues/8633

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   
   ### Paimon version
   
   1.4.1
   
   ### Compute Engine
   
   flink 1.14 + Hadoop 3.1.1
   
   ### Minimal reproduce step
   
   -- 1.create paimon catalog
   CREATE CATALOG pc WITH (
       'type' = 'paimon',
       'warehouse' = 'file:///tmp/paimon-warehouse'
   );
   
   -- 2. test case, first create three base table 
   CREATE TABLE IF NOT EXISTS pc.test.user_info (
       user_id BIGINT,
       user_name STRING,
       age INT,
       PRIMARY KEY (user_id) NOT ENFORCED
   );
   
   CREATE TABLE IF NOT EXISTS pc.test.user_ext_info (
       user_id BIGINT,
       address STRING,
       phone STRING,
       PRIMARY KEY (user_id) NOT ENFORCED
   );
   
   CREATE TABLE IF NOT EXISTS pc.test.user_level (
       user_id BIGINT,
       level STRING,
       score INT,
       PRIMARY KEY (user_id) NOT ENFORCED
   ) WITH (
       'bucket' = '10',
       'bucket-key' = 'user_id'
   );
   
   -- 3. create union view 
   CREATE VIEW IF NOT EXISTS view_user_union AS
   SELECT 
       user_id, 
       user_name, 
       age, 
       CAST(NULL AS STRING) AS address,
       CAST(NULL AS STRING) AS phone
   FROM pc.test.user_info
   
   UNION ALL
   
   SELECT 
       user_id, 
       CAST(NULL AS STRING) AS user_name,
       CAST(NULL AS INT) AS age,
       address, 
       phone
   FROM pc.test.user_ext_info;
   
   -- 4. assert found
   SELECT 
       u.user_id,
       u.user_name,
       u.age,
       u.address,
       u.phone,
       l.level,
       l.score
   FROM view_user_union u
   LEFT JOIN pc.test.user_level l ON u.user_id = l.user_id;
   
   
   ### What doesn't meet your expectations?
   
   The SELECT statement is expected to execute normally
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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