Added missing unittests for primitive schema types#4147
Added missing unittests for primitive schema types#4147srkukarni merged 5 commits intoapache:masterfrom
Conversation
| SchemaCompatibilityStrategy strategy) { | ||
| if (SchemaType.isPrimitiveSchemaType(existingSchema.schema.getType())) { | ||
| // for primitive data types, only schema type check is needed | ||
| return existingSchema.schema.getType() == newSchema.getType(); |
There was a problem hiding this comment.
@srkukarni even from primitive types you still should check this condition:
compatibilityChecks.getOrDefault(newSchema.getType(), SchemaCompatibilityCheck.DEFAULT)
.isCompatible(existingSchema.schema, newSchema, strategy);
There was a problem hiding this comment.
I don't think we should add avro schema info to primitive schema types. moving my -1 from #4022 here.
-
SchemaType is already enough to describe what is the primitive type and how it is serialized and deserialized. Adding avro schema data to the schema info is redundant. As I explained in #4022, you don't need additional avro schema data for supporting primitive types in presto (or integrating with other query/computing engines).
-
adding schema data is a breaking change. it is breaking at two levels:
a) primitive types are not evolvable. so you shouldn't change schema data and schema type. unless there is a really really strong reason to break this assumption.
b) for supporting a query engine to query primitive types, you don't need to add schema data. schema type is enough. it seems to me that you are taking a wrong approach on implementing a feature that doesn't require adding redundant schema data, which enforcing people to upgrade to break their applications.
|
@sijie @jerrypeng Based on @sijie feedback and our discussion, I've removed the schema changes and only kept the unittest additions. Please take a look again. Thanks! |
|
run cpp tests |
Motivation
Currently we dont have any unittests for schemas. This pr adds them
Modifications
Describe the modifications you've done.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation