Closed mrt181 closed 5 months ago
Hi @mrt181, could you please confirm that the expected generated KSQL statement should match the following?
INSERT INTO Amounts (volume) VALUES (1.12345678912345);
private record Amount
{
[JsonPropertyName("volume")]
[Decimal(20, 8)]
public decimal Volume { get; init; }
}
var amount = new Amount
{
Volume = 1.12345678912345M,
};
string statement = new CreateInsert(new ModelBuilder()).Generate(amount);
Hi @mrt181, could you please confirm that the expected generated KSQL statement should match the following?
INSERT INTO Amounts (volume) VALUES (1.12345678912345);
That's correct the current implemenation creates this:
INSERT INTO Amounts (volume) VALUES (STRUCT());
While it also creates this table definition:
string createTable = new StatementGenerator().CreateTable<Amount>(metadata);
CREATE TABLE `Amounts` ( `volume` DECIMAL(20,8) ) WITH ( KAFKA_TOPIC='amounts', VALUE_FORMAT='Json', PARTITIONS='1', REPLICAS='1' );
I published a hot fix:
dotnet add package ksqlDb.RestApi.Client --version 6.0.2
Describe the bug When I define a Property like this:
The created statement during an insert uses this type
The
volume
property is within anARRAY[STRUCT()]
type that itself is within anARRAY[STRUCT]
type. When I change the property type todouble
it uses theDECIMAL(20,8)
in the insert statement.Expected behavior The
DECIMAL(20,8)
type should be used when the property has that attribute even when its c# type isdecimal
.Environment (please complete the following information):
ksqlDb
version:v7.6.0
ksqlDb.RestApi.Client
Nuget package versionv6.0.1
net8.0