-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display precision and scale when describing DECIMAL columns (#6872
- Loading branch information
Showing
8 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
ksqldb-rest-model/src/test/java/io/confluent/ksql/rest/entity/SchemaInfoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.confluent.ksql.rest.entity; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import io.confluent.ksql.schema.ksql.types.SqlBaseType; | ||
import org.junit.Test; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.equalTo; | ||
|
||
public class SchemaInfoTest { | ||
|
||
@Test | ||
public void shouldCorrectlyFormatDecimalsWithPrecisionAndScale() { | ||
|
||
final SchemaInfo schemaInfo= new SchemaInfo( | ||
SqlBaseType.DECIMAL, | ||
null, | ||
null, | ||
ImmutableMap.of("precision", 10, "scale", 9) | ||
); | ||
assertThat(schemaInfo.toTypeString(), equalTo("DECIMAL(10, 9)")); | ||
} | ||
|
||
@Test | ||
public void shouldCorrectlyFormatDecimalsWithoutParameters() { | ||
final SchemaInfo schemaInfo= new SchemaInfo( | ||
SqlBaseType.DECIMAL, | ||
null, | ||
null | ||
); | ||
assertThat(schemaInfo.toTypeString(), equalTo("DECIMAL")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters