You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "a8356555 (via GitHub)" <gi...@apache.org> on 2023/10/19 04:29:54 UTC

[I] Flink: INSERT INTO worked with tuples but NOT writing data with select statement [iceberg]

a8356555 opened a new issue, #8874:
URL: https://github.com/apache/iceberg/issues/8874

   ### Apache Iceberg version
   
   1.4.0 (latest release)
   
   ### Query engine
   
   Flink
   
   ### Please describe the bug 🐞
   
   I'm using pyflink to write data to s3 bucket in iceberg format.
   
   The following code worked, and the data showed in s3 bucket:
   ```
   target_table = 'mycatalog.mydb.mytable'
   stenv.execute_sql('''
       INSERT INTO {target_table}
       Values (TIMESTAMP '2023-10-17', 1697525314, 2341, '', '192.168.3.41', 'WS', 'APP', 'Unknown', 'ZZ', TIMESTAMP '2023-10-17 06:48:34', false)
   ''')
   
   # log:
   # 2023-10-19 04:19:00,985 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new compressor [.gz]
   # 2023-10-19 04:19:01,007 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new compressor [.gz]
   ```
   
   However, when I use the select statement, the query is executed (there's still log showing) but the data didn't show up in s3.
   ```
   stenv.execute_sql(f'''
       INSERT INTO {target_table} 
       SELECT 
           *
       FROM event
   ''')
   
   # part of log
   # 2023-10-19 04:18:13,363 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:13,520 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:13,656 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:13,821 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:13,998 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:14,155 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:14,298 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:14,443 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:14,590 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:14,730 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:18:14,913 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   ```
   
   the `event` table has been checked through the print connector:
   ```
   stenv.execute_sql(f'''CREATE TABLE print_table (
                           *sql_schema_as_target_table*
                       ) WITH ('connector' = 'print')''')
   
   stenv.execute_sql(f'''
       INSERT INTO print_table
       SELECT 
           *
       FROM event
   ''') 
   
   # part of log:
   # +I[2023-10-16T17:31:58, 1697448718, 2318, , 192.168.3.57, WS, APP, Unknown, ZZ, 2023-10-16T09:31:58, false]
   # +I[2023-10-16T11:24:18, 1697426658, 2469, 2D3B7326-944B-44C1-A2B2-923B44B0AD5, 192.168.3.63, WS, APP, Unknown, ZZ, 2023-10-16T03:24:18, false]
   # +I[2023-10-16T11:24:25, 1697426665, 3287, 2D3B7326-944B-44C1-A2B2-923B44B0AD5, 192.168.3.66, WS, APP, Unknown, ZZ, 2023-10-16T03:24:25, false]
   # +I[2023-10-16T11:53:01, 1697428381, 3287, 2D3B7326-944B-44C1-A2B2-923B44B0AD5, 192.168.3.66, WS, APP, Unknown, ZZ, 2023-10-16T03:53:01, false]
   # +I[2023-10-17T16:19:16, 1697530756, 2201, A164D39D-B432-4ECA-8F24-456D28A8AC68, 192.168.20.111, WS, APP, Unknown, ZZ, 2023-10-17T08:19:16, false]
   # 2023-10-19 04:17:17,433 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:17:17,588 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   # 2023-10-19 04:17:17,751 INFO  org.apache.hadoop.io.compress.CodecPool                      [] - Got brand-new decompressor [.gz]
   ```
   
   Does anyone have an idea? 
   
   I'm running my code in a docker container with python3.8
   here is my Dockerfile
   iceberg version: 1.4.0
   flink major version: 1.16
   pyflink version: 1.16.2
   scala version: 2.12
   ```
   FROM alpine:3.17.0 AS builder
   
   WORKDIR /tmp/download/my-jars
   RUN wget https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-flink-runtime-1.16/1.4.0/iceberg-flink-runtime-1.16-1.4.0.jar
   RUN wget https://repo1.maven.org/maven2/software/amazon/awssdk/bundle/2.17.263/bundle-2.17.263.jar
   RUN wget https://repo1.maven.org/maven2/software/amazon/awssdk/url-connection-client/2.17.263/url-connection-client-2.17.263.jar
   
   FROM apache/flink:1.16.2-scala_2.12-java8 AS runtime
   
   RUN apt-get update && apt-get install -y software-properties-common &&  \
       add-apt-repository -y ppa:deadsnakes/ppa &&  \
       apt-get remove -y software-properties-common && apt-get autoremove -y && apt-get clean
   RUN apt-get update && apt-get install -y python3.8 python3-pip python3.8-distutils git && apt-get clean
   RUN python3.8 -m pip install --upgrade pip
   RUN python3.8 -m pip install apache-flink==1.16.2 --no-cache-dir
   
   WORKDIR /tmp/download/my-hadoop
   RUN wget https://dlcdn.apache.org/hadoop/common/hadoop-3.3.4/hadoop-3.3.4.tar.gz &&  \
       tar xzf hadoop-3.3.4.tar.gz &&  \
       mv hadoop-3.3.4 /opt/hadoop-3.3.4 &&  \
       rm hadoop-3.3.4.tar.gz
   ENV HADOOP_HOME=/opt/hadoop-3.3.4
   ENV HADOOP_CLASSPATH=/opt/hadoop-3.3.4/etc/hadoop:/opt/hadoop-3.3.4/share/hadoop/common/lib/*:/opt/hadoop-3.3.4/share/hadoop/common/*:/opt/hadoop-3.3.4/share/hadoop/hdfs:/opt/hadoop-3.3.4/share/hadoop/hdfs/lib/*:/opt/hadoop-3.3.4/share/hadoop/hdfs/*:/opt/hadoop-3.3.4/share/hadoop/mapreduce/*:/opt/hadoop-3.3.4/share/hadoop/yarn:/opt/hadoop-3.3.4/share/hadoop/yarn/lib/*:/opt/hadoop-3.3.4/share/hadoop/yarn/*
   
   COPY --from=builder /tmp/download/my-jars/. /opt/flink/lib/.
   ```
   
   


-- 
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: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Flink: OverflowError: value too large to convert to int32_t [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #8874: Flink: OverflowError: value too large to convert to int32_t
URL: https://github.com/apache/iceberg/issues/8874


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Flink: INSERT INTO worked with tuples but NOT writing data with select statement [iceberg]

Posted by "a8356555 (via GitHub)" <gi...@apache.org>.
a8356555 commented on issue #8874:
URL: https://github.com/apache/iceberg/issues/8874#issuecomment-1769877830

   provide my catalog and table setting
   ```
   stenv.execute_sql(f'''
       CREATE CATALOG `mycatalog` 
       WITH (
           'type' = 'iceberg',
           'catalog-impl' = 'org.apache.iceberg.aws.glue.GlueCatalog',
           'io-impl' = 'org.apache.iceberg.aws.s3.S3FileIO',  
           'warehouse' = 's3://mywarehouse'
       )
   ''')
   target_table = f"`mycatalog`.`mydb`.`mytable`"
   stenv.execute_sql(f'''
       CREATE TABLE IF NOT EXISTS {target_table} (
           *sql_schema*,
       PRIMARY KEY(`pk`) NOT ENFORCED
       ) 
       PARTITIONED BY (`pk`)
   ''')
   ```


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Flink: OverflowError: value too large to convert to int32_t [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8874:
URL: https://github.com/apache/iceberg/issues/8874#issuecomment-2403653676

   This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Flink: OverflowError: value too large to convert to int32_t [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8874:
URL: https://github.com/apache/iceberg/issues/8874#issuecomment-2369824175

   This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org