confluentinc / confluentinc/ksql
Concat with double-pipe symbol (||) error with ksqlDB 0.6
- Dominant language
- Java
- Stars
- 315
- Forks
- 1k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 36
Description
**Describe the bug**
Concat of two text fields is documented as being supported with the double-pipe symbol (||) or the plus (+) operator. The plus (+) operator **does** work with ksqlDB 0.6, however double-pipe symbol (||) gives an error
**To Reproduce**
Steps to reproduce the behavior, include:
1. The version of KSQL.
0.6 ksqlDB
Demo code
```
create stream demostream (c1 varchar, c2 varchar) WITH (kafka_topic='demotopic', key='c1', value_format='json', partitions=1);
```
```
select c1 || c2 from demostream emit changes;
Code generation failed for Select: Cannot get name for `concat` 0 times. expression:concat(DEMOSTREAM.C1, DEMOSTREAM.C2), schema:[`DEMOSTREAM`.`ROWKEY` STRING KEY, `DEMOSTREAM`.`ROWTIME` BIGINT, `DEMOSTREAM`.`ROWKEY` STRING, `DEMOSTREAM`.`C1` STRING, `DEMOSTREAM`.`C2` STRING]
Caused by: Cannot get name for `concat` 0 times
```
This does however work
```
select c1 + c2 from demostream emit changes;
```
Contributor guide
Research direction
Reproduce the query from the issue against ksqlDB 0.6, starting with the reported Select code-generation error for the concat expression. Trace the concat handling from that error and compare it with the working plus-operator path; done means c1 || c2 executes successfully and returns concatenated values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kafka, sql
- Domain
- database, stream-processing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100