apache / pinot

Apache Pinot - A realtime distributed OLAP datastore
https://pinot.apache.org/
Apache License 2.0
5.39k stars 1.26k forks source link

Reject table creation request with space characters in table name. #5730

Open chenboat opened 4 years ago

chenboat commented 4 years ago

Today one can create a Pinot table with space characters in its name. We should reject such request because many downstream process like realtime ingestion do table name check about space characters.

E.g.,

java.net.URISyntaxException: Illegal character in query at index 87: http://streampinot-prod42-dca8:5983/segmentStoppedConsuming?name=emobility_rental_event __2__0__20200309T2338Z&offset=1425241&instance=Server_streampinot-prod138-dca8_7090&reason=org.apache.pinot.core.realtime.stream.TransientConsumerException
    at java.net.URI$Parser.fail(URI.java:2848)
    at java.net.URI$Parser.checkChars(URI.java:3021)
    at java.net.URI$Parser.parseHierarchical(URI.java:3111)
    at java.net.URI$Parser.parse(URI.java:3053)
    at java.net.URI.<init>(URI.java:588)
    at o.a.p.s.r.ServerSegmentCompletionProtocolHandler.sendRequest(ServerSegmentCompletionProtocolHandler.java:179)
    at o.a.p.s.r.ServerSegmentCompletionProtocolHandler.segmentStoppedConsuming(ServerSegmentCompletionProtocolHandler.java:157)
    at o.a.p.c.d.m.r.LLRealtimeSegmentDataManager.postStopConsumedMsg(LLRealtimeSegmentDataManager.java:857)
    at o.a.p.c.d.m.r.LLRealtimeSegmentDataManager$PartitionConsumer.run(LLRealtimeSegmentDataManager.java:5...
xiangfu0 commented 4 years ago

Make sense. I had one PR to prevent users from creating tables with dot: https://github.com/apache/incubator-pinot/pull/5714

I think we can extend it to evaluate a valid table name here.