OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Additional custom property types

Open gavindew opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. We have a number of custom properties we would like to tag tables with. Open Metadata only supports string, markdown and integer types for custom properties.

Describe the solution you'd like We would like to add a boolean (true / false) as well as a list type (where a list of possible options is selected from a dropdown). The list type should be single or multi select capable, similar to selecting tags.

Whilst it is possible to use tags for multi-select options, we see the types of data we would like to add into custom properties are more technical in nature and not the kind of thing normal users should see.

Describe alternatives you've considered As an interim measure we are storing Y/N and entering strings into string fields. This however is prone to user error.

Additional context None

gavindew avatar Aug 14 '23 20:08 gavindew

I ran into a similar Issue. For one use case, we'd like to store a list of urls for each table, and so a custom property seems like a good fit. The API allows me to add this by specifying an appropriate JSON schema, and it works as long as OM is up, but then on restart OM has boot errors and poor behavior.

INFO [2023-08-07 16:30:26,542] [main] o.o.s.TypeRegistry - Adding custom property table.customProperties.customTableProperty with JSON schema "#" : {"$comment":"@om-field-type","description":"A String type.","type":"string"}
INFO [2023-08-07 16:30:26,542] [main] o.o.s.TypeRegistry - Adding custom property table.customProperties.foo with JSON schema "#" : {"$comment":"@om-field-type","description":"A String type.","type":"string"}
INFO [2023-08-07 16:30:26,542] [main] o.o.s.TypeRegistry - Adding custom property table.customProperties.markfoo with JSON schema "#" : {"$comment":"@om-field-type","description":"Text in Markdown format.","type":"string"}
ERROR [2023-08-07 16:30:26,558] [main] o.o.s.r.t.TypeResource - Error loading type table
java.lang.NullPointerException: null
        at org.openmetadata.service.TypeRegistry.addCustomProperty(TypeRegistry.java:70)
        at org.openmetadata.service.TypeRegistry.addType(TypeRegistry.java:56)
        at org.openmetadata.service.jdbi3.TypeRepository.updateTypeMap(TypeRepository.java:86)
        at org.openmetadata.service.jdbi3.TypeRepository.addToRegistry(TypeRepository.java:76)
        at org.openmetadata.service.resources.types.TypeResource.lambda$initialize$1(TypeResource.java:118)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.openmetadata.service.resources.types.TypeResource.initialize(TypeResource.java:101)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.openmetadata.service.resources.CollectionRegistry.createResource(CollectionRegistry.java:260)
        at org.openmetadata.service.resources.CollectionRegistry.registerResources(CollectionRegistry.java:172)
        at org.openmetadata.service.OpenMetadataApplication.registerResources(OpenMetadataApplication.java:438)
        at org.openmetadata.service.OpenMetadataApplication.run(OpenMetadataApplication.java:190)
        at org.openmetadata.service.OpenMetadataApplication.run(OpenMetadataApplication.java:124)
        at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:67)
        at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
        at io.dropwizard.cli.Cli.run(Cli.java:78)
        at io.dropwizard.Application.run(Application.java:94)
        at org.openmetadata.service.OpenMetadataApplication.main(OpenMetadataApplication.java:482)
curl 'http://18.217.204.148:8585/api/v1/tables/e9c7a59a-3222-4a50-942a-06c4199003b1' \                                                                                                                                            main ⬇ ✚ ✱
  -X 'PATCH' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Authorization: Bearer ....
  -H 'Content-Type: application/json-patch+json' \
  --data-raw '[{"op":"add","path":"/extension/urls","value":["fools", "tool"]}]' \
  --compressed \
  --insecure

{"code":400,"message":"Unknown custom field urls"}%

joegoldbeck avatar Nov 07 '23 14:11 joegoldbeck