You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/20 15:58:45 UTC

[GitHub] [pulsar] dlg99 opened a new issue #10271: schema registry / pulsar-admin: Schema type BYTES is returned as Schema type NONE

dlg99 opened a new issue #10271:
URL: https://github.com/apache/pulsar/issues/10271


   **Describe the bug**
   
   Schema type BYTES set for the topic is returned as Schema type NONE.
   
   I hit this issue while working on the sink that uses GenericObject / relies on AutoConsumeSchema returning correct schema.
   While there is a workaround there to make AutoConsumeSchema handle schema type NONE as BYTES this whole behavior is rather unexpected and illogical.
   
   **To Reproduce**
   
   ```
   $ bin/pulsar-admin schemas delete my-topic 
   $ bin/pulsar-admin schemas get my-topic
   HTTP 404 Not Found
   Reason: HTTP 404 Not Found
   ```
   This is ok.
   
   ```
   $ cat ~/schema2.json 
   {
       "type": "BYTES",
       "schema": "",
       "properties": {}
   }
   
   $ bin/pulsar-admin schemas upload --filename ~/schema2.json my-topic 
   $ bin/pulsar-admin schemas get my-topic    
   {
     "version": 8,
     "schemaInfo": {
       "name": "my-topic",
       "schema": "",
       "type": "NONE",
       "properties": {}
     }
   }
   ```
   
   **Expected behavior**
   
   Expect to get the same schema as the one I set (BYTES)
   
   **Desktop (please complete the following information):**
    - OS: macOS
   
   **Additional context**
   
   version 2.8.0-snapshot
   
   I think it is related to  SchemaRegistryServiceImpl convertToDomainType/convertFromDomainType where any type with type.getValue() < 0  is treated as NONE.
   src/main/proto/SchemaRegistryFormat.proto doesn’t even have SchemaType.BYTES
   SchemaType.BYTES is -1.
   Other things with negative values there are AUTO/AUTO_CONSUME/AUTO_PUBLISH.
   
   I haven't looked at what else handles BYTES as a special case compared with other schemas (STRING, INT.., ...)
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on issue #10271: schema registry / pulsar-admin: Schema type BYTES is returned as Schema type NONE

Posted by GitBox <gi...@apache.org>.
eolivelli commented on issue #10271:
URL: https://github.com/apache/pulsar/issues/10271#issuecomment-823401347


   I am reopening the issue, as my PR did not address the problem directly.
   
   Setting SchemaType = BYTES means to not set a schema at all, I am not sure about what it the best behaviour we should implement.
   
   
   @jerrypeng @sijie what do you think ?
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on issue #10271: schema registry / pulsar-admin: Schema type BYTES is returned as Schema type NONE

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #10271:
URL: https://github.com/apache/pulsar/issues/10271#issuecomment-1058891393


   The issue had no activity for 30 days, mark with Stale label.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli closed issue #10271: schema registry / pulsar-admin: Schema type BYTES is returned as Schema type NONE

Posted by GitBox <gi...@apache.org>.
eolivelli closed issue #10271:
URL: https://github.com/apache/pulsar/issues/10271


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org