You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Alexander Trushev (Jira)" <ji...@apache.org> on 2022/07/18 01:50:00 UTC
[jira] [Updated] (FLINK-24342) Filesystem sink does not escape right bracket in partition name
[ https://issues.apache.org/jira/browse/FLINK-24342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander Trushev updated FLINK-24342:
--------------------------------------
Description:
h3. How to reproduce the problem
In the following code snippet filesystem sink creates a partition named "\{date\}" and writes value "1" to file.
{code:sql}
create table sink (
val int,
part string
) partitioned by (part) with (
'connector' = 'filesystem',
'path' = '/tmp/sink',
'format' = 'csv'
);
insert into sink values (1, '{date}');
{code}
h3. Expected behavior
Escaped "\{" and "\}" in partition name
{code}
$ ls /tmp/sink/
part=%7Bdate%7D
{code}
h3. Actual behavior
Escaped only "\{" in partition name
{code}
$ ls /tmp/sink/
part=%7Bdate}
{code}
was:
h3. How to reproduce the problem
In the following code snippet filesystem sink creates a partition named "\{date\}" and writes content "1" to file.
{code:scala}
val env = StreamExecutionEnvironment.getExecutionEnvironment
val tEnv = StreamTableEnvironment.create(env)
val source = env.fromElements(("{date}", 1))
tEnv.createTemporaryView("source", source)
val sinkSql =
"""
|create table sink (
| part string,
| content int
|) partitioned by (part) with (
| 'connector' = 'filesystem',
| 'path' = '/tmp/sink',
| 'format' = 'csv'
|)
|""".stripMargin
tEnv.executeSql(sinkSql).await()
tEnv.executeSql("insert into sink select * from source").await()
{code}
h3. Expected behavior
Escaped "\{" and "\}" in partition name
{code}
$ ls /tmp/sink/
part=%7Bdate%7D
{code}
h3. Actual behavior
Escaped only "\{" in partition name
{code}
$ ls /tmp/sink/
part=%7Bdate}
{code}
> Filesystem sink does not escape right bracket in partition name
> ---------------------------------------------------------------
>
> Key: FLINK-24342
> URL: https://issues.apache.org/jira/browse/FLINK-24342
> Project: Flink
> Issue Type: Bug
> Components: Connectors / FileSystem
> Reporter: Alexander Trushev
> Priority: Not a Priority
> Labels: auto-deprioritized-minor, pull-request-available
>
> h3. How to reproduce the problem
> In the following code snippet filesystem sink creates a partition named "\{date\}" and writes value "1" to file.
> {code:sql}
> create table sink (
> val int,
> part string
> ) partitioned by (part) with (
> 'connector' = 'filesystem',
> 'path' = '/tmp/sink',
> 'format' = 'csv'
> );
> insert into sink values (1, '{date}');
> {code}
> h3. Expected behavior
> Escaped "\{" and "\}" in partition name
> {code}
> $ ls /tmp/sink/
> part=%7Bdate%7D
> {code}
> h3. Actual behavior
> Escaped only "\{" in partition name
> {code}
> $ ls /tmp/sink/
> part=%7Bdate}
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)