Re: [Python] Should we make the schema default compatible with Java client?

2023-03-30 Thread 丛搏
Hi, Yunze: +1 > Just checked this thread and found I didn't paste this issue: > https://github.com/apache/pulsar-client-python/issues/108. You can see > the schema compatibility strategy is FORWARD, then the sorted schema > from the Java client overwrote the unsorted schema from the Python >

Re: [Python] Should we make the schema default compatible with Java client?

2023-03-30 Thread Yunze Xu
> Will it register a new schema? Only when it could pass the schema compatibility strategy. BTW, the existing schema compatibility checker does not check the order of fields, while it is very important. IMO, it's a bug of the broker. Just checked this thread and found I didn't paste this issue:

Re: [Python] Should we make the schema default compatible with Java client?

2023-03-30 Thread 丛搏
Hi, Yunze: > Regarding the 1st question, yes, that's why I open this thread to > discuss. If we change these default values, the behavior of new Python > clients will be like the Java client. In addition, it actually reverts > the breaking change brought in #12232. I also kind of forget why we

Re: [Python] Should we make the schema default compatible with Java client?

2023-03-30 Thread Yunze Xu
Hi Bo, Regarding the 1st question, yes, that's why I open this thread to discuss. If we change these default values, the behavior of new Python clients will be like the Java client. In addition, it actually reverts the breaking change brought in #12232. Regarding the 2nd question, yes, they are

Re: [Python] Should we make the schema default compatible with Java client?

2023-03-29 Thread 丛搏
Hi, Yunze : 1. If the changes may cause some compatibility issues. How do we solve the compatibility issues? It may be a breaking change. 2. Another question is if sorting is enabled by default, is the sorting rule the same as java or other clients? Putting aside the above two problems, I think

Re: [Python] Should we make the schema default compatible with Java client?

2023-03-29 Thread Eric Hare
+1 - i think keeping the `_sorted_fields` and `_required` defaults consistent between the clients is the way to go. > On Mar 29, 2023, at 7:09 AM, Yunze Xu wrote: > > I found the Python client has two options to control the behavior: > 1. Set `_sorted_fields`. It's false by default in the

Re: [Python] Should we make the schema default compatible with Java client?

2023-03-29 Thread Yunze Xu
I found the Python client has two options to control the behavior: 1. Set `_sorted_fields`. It's false by default in the Python client, but it's true in the Java client. i.e. the Java client sorts all fields by default. 2. Set `_required`. It's false by default for all types in the Python client,

[Python] Should we make the schema default compatible with Java client?

2023-03-29 Thread Yunze Xu
Hi all, Recently I found the default generated schema definition in the Python client is different from the Java client, which leads to some unexpected behavior. For example, given the following class definition in Python: ```python class Data(Record): i = Integer() ``` The type of `i`