li-boxuan commented on code in PR #1657:
URL: https://github.com/apache/tinkerpop/pull/1657#discussion_r877020771


##########
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java:
##########
@@ -411,6 +404,15 @@ public boolean willAllowId(final Object id) {
         public VertexProperty.Cardinality getCardinality(final String key) {
             return defaultVertexPropertyCardinality;
         }
+
+        @Override
+        public VertexProperty.Cardinality getCardinality(final String key, 
final Object... values) {

Review Comment:
   I totally agree with your concerns and it makes sense to be cautious about 
breaking changes. I would like to formulate the problems in two aspects:
   
   1. Is it worth adding this new interface in general (with default behavior 
preserved)?
   
   Maybe. It might be impossible or discouraged to change the default 
cardinality on the fly for some graph implementers. That being said, your 
concerns about SubgraphStep, PartitionStrategy, etc. still holds here.
   
   2. Is it worth introducing this breaking change in TinkerGraph?
   
   Probably not due to the reasons you gave. However, I think it is still worth 
considering the following actions:
   
   a) Add a reminder to IO step on doc. I personally didn’t know that TinkerPop 
would not infer cardinality from input file. The fact that you might lose data 
(list/set properties) when you export and import again really confused me for 
some time. Not sure if it is documented somewhere else, but I read the source 
code to finally figure it out.
   
   b) We can still infer the cardinality but we don’t really use it to preserve 
old behavior. Instead, we give a warning to users when we detect discrepancy 
between inferred cardinality and default cardinality.



-- 
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]

Reply via email to