You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Martijn Visser (Jira)" <ji...@apache.org> on 2021/12/30 13:20:00 UTC

[jira] [Created] (FLINK-25488) Using a pipe symbol as pair delimiter in STR_TO_MAP in combination with concatenation results in broken output

Martijn Visser created FLINK-25488:
--------------------------------------

             Summary: Using a pipe symbol as pair delimiter in STR_TO_MAP in combination with concatenation results in broken output 
                 Key: FLINK-25488
                 URL: https://issues.apache.org/jira/browse/FLINK-25488
             Project: Flink
          Issue Type: Bug
            Reporter: Martijn Visser


Reproducible using Flink Faker:

{code:sql}
-- Create source table
CREATE TABLE `customers` (
  `identifier` STRING,
  `fullname` STRING,
  `postal_address` STRING,
  `residential_address` STRING
) WITH (
  'connector' = 'faker',
  'fields.identifier.expression' = '#{Internet.uuid}',
  'fields.fullname.expression' = '#{Name.firstName} #{Name.lastName}',
  'fields.postal_address.expression' = '#{Address.fullAddress}',
  'fields.residential_address.expression' = '#{Address.fullAddress}',
  'rows-per-second' = '1'
);
{code}

{code:sql}
-- Doesn't generate expected output
SELECT 
  `identifier`,
  `fullname`,
  STR_TO_MAP('postal_address:' || postal_address || '|residential_address:' || residential_address,'|',':') AS `addresses`
FROM `customers`;
{code}

Output will look like:
{code:sql}
{=, A=null, C=null, D=null, L=null, O=null, P=null, S=null, T=null, _=null,  =null, a=null, b=null, c=null, d=null, e=null, g=null, h=null, i=null, ,=null, l=null, -=null, m=null, .=null, n=null, o=null, p=null, q=null, 2=null, r=null, 3=null, s=null, 4=null, t=null, 5=null, u=null, 6=null, v=null, 7=null, w=null, 8=null, 9=null, |=null}
{code}

When using:
{code:sql}
-- Output looks like expected when using a different separator 
SELECT 
  `identifier`,
  `fullname`,
  STR_TO_MAP('postal_address:' || postal_address || ';residential_address:' || residential_address,';',':') AS `addresses`
FROM `customers`;
{code}

The output looks as expected:
{code:sql}
{postal_address=6654 Chong Meadows, East Lupita, CT 51702-8560, residential_address=Apt. 098 51845 Shields Fork, North Erikland, NV 10386}
{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)