Closed mrt181 closed 8 months ago
These are the places that seem related to this but I have currently no idea how to fix this. The moment I touch it many tests that use column selection syntax break.
Hello @mrt181, this could be potentially fixed by adding the below else if branch before this line in KSqlVisitor.ProcessVisitNewMember
:
else if (expression is MemberExpression me2 && me2.Member.GetCustomAttribute<JsonPropertyNameAttribute>() != null)
Append(me2.Member.Format(QueryMetadata.IdentifierEscaping));
I've just quickly prototyped it for now. Please share your thoughts and feedback on it.
Alternative solution:
else if (expression is MemberExpression me2 && !me2.Member.DeclaringType.IsKsqlGrouping())
Append(me2.Member.Format(QueryMetadata.IdentifierEscaping));
Do we want to implement the suggested fix mentioned above? If so, I can prepare a pull request (PR), or would you prefer to handle it yourself?
I did an additional change to cover pseudocolumns and added some tests. If ok than I will create a PR.
Thank you @mrt181 for the PR! I released a patch:
dotnet add package ksqlDb.RestApi.Client --version 3.6.2
Describe the bug JsonPropertyNames are ignored when using syntax to selec individual columns.
To Reproduce
Expected behavior Both Tests should work but only the second one with the alias does. The first one uses
SubProperty
as column name.Environment (please complete the following information):
ksqlDb
version: 7.6.0ksqlDb.RestApi.Client
Nuget package version 3.6.1]Additional context This is needed when selecting
PseudoColumns
likeROWTIME
but will fail because a stream / table creates the column names using theJsonPropertyNames