tsungchih commented on issue #5202:
URL: https://github.com/apache/gravitino/issues/5202#issuecomment-2678660591
Thanks for the prompt reply and the reminder. So far in the repo, I have not
seen the code related to this issue though. After having dedicated myself a
couple of hours into the code, I came out the following list of Java classes
needs to be implemented in client-python.
- [ ] Column
- [ ] ColumnDTO
- [ ] SupportsTags
- [ ] Tag
- [ ] PartitionUtils
- [ ] FieldReferenceDTO
- [ ] FuncExpressionDTO
- [ ] LiteralDTO
- [ ] UnparsedExpressionDTO
- [ ] FunctionArg
- [ ] TypesSerializer
- [ ] TypesDeserializer
- [ ] ColumnDefaultValueSerializer
- [ ] ColumnDefaultValueDeserializer
- [ ] NoSuchTagException
- [ ] TagAlreadyExistsException
Could you please take a look at it to see if I missed something?
I feel the PR for this issue will be a little bit fat. Would you prefer to
embrace them all in a single PR or multiple PRs?
Here's the initial version of class diagram for your reference.
```mermaid
---
title: Class Diagram
---
classDiagram
class Tag {
<<interface>>
+PROPERTY_COLOR = "color"
+name(self) str
+comment(self) str
+properties(self) Dict[str, str]
+inherited(self) Optional[bool]
}
class SupportsTags {
<<interface>>
+list_tags(self) List[str]
+list_tags_info(self) List[Tag]
+get_tag(self, name: str) Tag
+associate_tags(self, tags_to_add: List[str], tags_to_remove:
List[str]) List[str]
}
class Column {
<<interface>>
+name(self) str
+data_type(self) Type
+comment(self) Optional[str]
+nullable(self) bool
+auto_increment(self) bool
+default_value(self) Expression
+supports_tags(self) SupportsTags
+of(name: str, data_type: Type, comment: Optional[str]=None,
nullable: bool=True, auto_increment: bool=False, default_value:
Optional[Expression]=None) ColumnImpl
}
class ColumnImpl {
__init__(self, name: str, data_type: Type, comment: Optional[str],
nullable: bool, auto_increment: boool, default_value: Optional[Expression])
}
class ColumnDTO {
-name: str
-data_type: Type
-comment: Optional[str]
-nullable: bool
-auto_increment: bool
-default_value: Expression
}
class ColumnDefaultValueSerde {
+serialize(cls, data: Expression) Optional[dict]
+deserialize(cls, data: Optional[dict]) Expression
}
class FieldReferenceDTO {
-field_name: List[str]
__init__(self, field_name: List[str])
-field_name(self) List[str]
-arg_type(self) FunctionArg.ArgType
}
class FuncExpressionDTO {
-function_name: str
-function_args: List[FunctionArg]
__init__(self, function_name: str, function_args: List[FunctionArg])
+args(self) List[FunctionArg]
+function_name(self) str
+arguments(self) List[Expression]
+arg_type(self) FunctionArg.ArgType
}
class PartitionUtils {
+validate_field_existence(columns: List[ColumnDTO], field_name:
List[str]) None
}
class FunctionArg {
<<interface>>
EMPTY_ARGS: list[FunctionArg] = []
+arg_type() ArgType
+validate(columns: list[ColumnDTO]) None
}
class LiteralDTO~str~ {
+NULL: LiteralDTO = LiteralDTO("NULL", Types.NullType.get())
-value: str
-data_type: Type
__init__(self, value: str, data_type: Type) None
+value() str
+data_type() Type
+arg_type() FunctionArg.ArgType
__repr__(self) str
}
class SerdeBase~T,U~ {
<<interface>>
+serialize(cls, data: T) U
+deserialize(cls, data: U) T
}
class TypesSerde {
+serialize(cls, data: Type) str
+deserialize(cls, data: str) Type
}
Auditable <|-- Tag
Expression <|-- Literal
Tag <.. SupportsTags
SupportsTags <.. Column
Column <|.. ColumnImpl: implements
Column <|.. ColumnDTO: implements
ColumnDTO <.. FunctionArg
ColumnDTO <.. PartitionUtils
DataClassJsonMixin <|.. ColumnDTO: implements
SerdeBase <|.. TypesSerde: implements
SerdeBase <|.. ColumnDefaultValueSerde: implements
Expression <|-- FunctionArg
PartitionUtils <.. FunctionArg
TypesSerde <.. ColumnDTO
ColumnDefaultValueSerde <.. ColumnDTO
Literal <|.. LiteralDTO: implements
FunctionArg <|.. LiteralDTO: implements
NamedReference <|.. FieldReferenceDTO: implements
FunctionArg <|.. FieldReferenceDTO: implements
FunctionExpression <|.. FuncExpressionDTO: implements
FunctionArg <|.. FuncExpressionDTO: implements
LiteralDTO <.. ColumnDefaultValueSerde
FieldReferenceDTO <.. ColumnDefaultValueSerde
FuncExpressionDTO <.. ColumnDefaultValueSerde
```
--
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]