[
https://issues.apache.org/jira/browse/FLINK-32993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17760234#comment-17760234
]
Yunhong Zheng commented on FLINK-32993:
---------------------------------------
Hi, [~liyubin117] . it's a by design behavior. If you want to specify the
length of char, u need to add 'fieds.#.length' into table options as the
document requirement:
[document|https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/connectors/table/datagen/#fields-length].
specify char(50) in the schema is invalid(default 100). In your case, your
ddl need change to:
{code:java}
create table t1(name string, addr string) with ('connector' = 'datagen',
'fields.name.length' = '50');{code}
> Datagen connector produce unexpected Char type data
> ---------------------------------------------------
>
> Key: FLINK-32993
> URL: https://issues.apache.org/jira/browse/FLINK-32993
> Project: Flink
> Issue Type: Improvement
> Components: Connectors / Common
> Affects Versions: 1.19.0
> Reporter: Yubin Li
> Priority: Major
> Attachments: image-2023-08-30-11-47-05-887.png,
> image-2023-08-30-11-47-43-719.png, image-2023-08-30-11-51-44-498.png
>
>
> create table as follows:
> !image-2023-08-30-11-51-44-498.png!
> results:
> !image-2023-08-30-11-47-05-887.png!
> I have found that Char type data length is 100, which same as String type, it
> is caused by the two types use the same data generation logic, and we could
> correct it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)