mchades commented on code in PR #12499: URL: https://github.com/apache/gravitino/pull/12499#discussion_r3830983991
########## api/src/main/java/org/apache/gravitino/semantic/DataType.java: ########## @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.gravitino.semantic; + +import org.apache.gravitino.annotation.Evolving; + +/** Logical data types for Semantic Model fields and metrics. */ +@Evolving +public enum DataType { + /** A string value. */ + STRING, + + /** An integer value. */ + INTEGER, + + /** An exact base-10 decimal value with unspecified precision and scale. */ + DECIMAL, Review Comment: Yes, this is intentional. `DataType` follows the pinned Ossie logical type vocabulary and is deliberately independent of `org.apache.gravitino.rel.types.Type`. Ossie defines `Decimal` as an exact base-10 value with unspecified precision and scale. Gravitino does not infer or convert this value from source column types; it is optional semantic metadata supplied by the model author, so connectors do not need a second mapping table for this API. Reusing `Type` would couple the semantic contract to physical/catalog representations that are not part of the Ossie vocabulary. The tradeoff is intentional: this version of the semantic contract does not carry decimal precision or scale. I’ll clarify the independence from physical relational types in the `DataType` Javadoc. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
