-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: implements ARRAY_JOIN as requested in (#5028) #5474
Conversation
@confluentinc It looks like @hpgrahsl just signed our Contributor License Agreement. 👍 Always at your service, clabot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks pretty good! Always happy to see you contributing @hpgrahsl 😂
It is missing what we call "QueryTranslationTests", you can see an example of one in substring.json
. After you write this file (you can actually move the more complex tests in ArrayJoinTest.java
to this file) you will need to generate the plans that we use to make sure things stay backwards compatible across versions. To do that, simply un-ignore and run PlannedTestGeneratorTest
.
ksqldb-engine/src/main/java/io/confluent/ksql/function/udf/array/ArrayJoin.java
Outdated
Show resolved
Hide resolved
ksqldb-engine/src/main/java/io/confluent/ksql/function/udf/array/ArrayJoin.java
Outdated
Show resolved
Hide resolved
ksqldb-engine/src/main/java/io/confluent/ksql/function/udf/array/ArrayJoin.java
Show resolved
Hide resolved
ksqldb-engine/src/main/java/io/confluent/ksql/function/udf/array/ArrayJoin.java
Outdated
Show resolved
Hide resolved
ksqldb-engine/src/test/java/io/confluent/ksql/function/udf/array/ArrayJoinTest.java
Outdated
Show resolved
Hide resolved
ksqldb-engine/src/test/java/io/confluent/ksql/function/udf/array/ArrayJoinTest.java
Show resolved
Hide resolved
I have to look into this and might have further questions most likely about this. I wrote the tests in relation to other, existing array function tests and haven't seen anything like this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with a couple of suggestions!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hpgrahsl thank you for the excellent contribution!
as requested by reviewers: - removed BigInteger from primitive types - added Long and BigDecimal to supported primitive types - dropped support for complex nested types - switched to hamcrest matchers in unit tests - added QueryTranslationTest for via PlannedTestGeneratorTest - adapted docs accordingly
as requested by reviewers: - removed BigInteger from primitive types - added Long and BigDecimal to supported primitive types - dropped support for complex nested types - switched to hamcrest matchers in unit tests - added QueryTranslationTest for via PlannedTestGeneratorTest - adapted docs accordingly
as requested by reviewers:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thanks for the contribution @hpgrahsl
Co-authored-by: Hans-Peter Grahsl <[email protected]>
* feat: implements ARRAY_JOIN as requested in (#5028) (#5474) (#5638) Co-authored-by: Hans-Peter Grahsl <[email protected]> * feat: new split_to_map udf (#5563) New UDF split_to_map(input, entryDelimiter, kvDelimiter) to build a map from a string. Useful for taking messages from upstream systems and converting them into a more structured and usable format. * feat: add CHR UDF (#5559) A new UDF, CHR, to turn a number representing a unicode codepoint into a single-character string. Very useful for dealing with non-printable characters (tab, CR, LF, ...) in strings or those characters not easily represented in your local codepage. Co-authored-by: Steven Zhang <[email protected]> Co-authored-by: Hans-Peter Grahsl <[email protected]> Co-authored-by: Nick Dearden <[email protected]>
Description
This PR implements the UDF / scalar function ARRAY_JOIN as requested in (#5028). It creates a flat string representation of all the elements contained in the given array.
Testing done
There are unit tests with several applications of the UDF to verify that it follows the expected behaviour as discussed in the linked issue.