Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you write the value of a field in Chinese in flink sql, garbled characters appear #3491

Open
2 of 3 tasks
weiguang660 opened this issue Jan 15, 2024 · 3 comments
Open
2 of 3 tasks
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@weiguang660
Copy link

weiguang660 commented Jan 15, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Java Version

No response

Scala Version

2.11.x

StreamPark Version

2.1.1

Flink Version

1.15.3

deploy mode

None

What happened

If you write the value of a field in Chinese in flink sql, garbled characters appear
(在flink sql中写死某个字段的值为中文,会乱码)

Error Exception

1.Flink SQL:
CREATE TABLE datagen (
    f_sequence INT,
    f_random INT,
    f_random_str STRING,
    ts AS localtimestamp,
    WATERMARK FOR ts AS ts
  ) WITH (
    'connector' = 'datagen',
    -- optional options测试 --
    'rows-per-second'='5',
    'fields.f_sequence.kind'='sequence',
    'fields.f_sequence.start'='1',
    'fields.f_sequence.end'='500',
    'fields.f_random.min'='1',
    'fields.f_random.max'='500',
    'fields.f_random_str.length'='10'
  );

  CREATE TABLE print_table (
    f_sequence INT,
    f_random INT,
    f_random_str STRING,
    test_field STRING
    ) WITH (
    'connector' = 'print'
  );

  INSERT INTO print_table select f_sequence,f_random,f_random_str,'测试' from datagen;

2.output:
[38, 313, 7ca456f4da, ??????]

3.Job Manager:
CREATE TABLE datagen (
    f_sequence INT,
    f_random INT,
    f_random_str STRING,
    ts AS localtimestamp,
    WATERMARK FOR ts AS ts
  ) WITH (
    'connector' = 'datagen',
    -- optional options?????? --
    'rows-per-second'='5',
    'fields.f_sequence.kind'='sequence',
    'fields.f_sequence.start'='1',
    'fields.f_sequence.end'='500',
    'fields.f_random.min'='1',
    'fields.f_random.max'='500',
    'fields.f_random_str.length'='10'
  );

  CREATE TABLE print_table (
    f_sequence INT,
    f_random INT,
    f_random_str STRING,
    test_field STRING
    ) WITH (
    'connector' = 'print'
  );

  INSERT INTO print_table select f_sequence,f_random,f_random_str,'??????' from datagen;

Screenshots

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!(您是否要贡献这个PR?)

Code of Conduct

@weiguang660 weiguang660 added the bug Something isn't working label Jan 15, 2024
@caicancai caicancai added the good first issue Good for newcomers label Jan 16, 2024
@skyoct
Copy link

skyoct commented Jan 19, 2024

@caicancai I want to give it a try

@caicancai
Copy link
Member

caicancai commented Jan 19, 2024

@caicancai I want to give it a try

Cool. Looking forward to your PR

@weiguang660
Copy link
Author

Has this issue been resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants