prajwal-jadhav01 commented on code in PR #20121:
URL: https://github.com/apache/pinot/pull/20121#discussion_r4442076609
##########
pinot-connectors/pinot-flink-connector/src/main/java/org/apache/pinot/connector/flink/sink/PinotSink.java:
##########
@@ -137,6 +140,21 @@ static TableConfig prepareTableConfigForSink(TableConfig
tableConfig, String con
return tableConfig;
}
+ /// Builds an [AuthProvider] from the `authToken` in the table's batch
config, or returns null if none is set.
+ @Nullable
+ static AuthProvider createAuthProvider(TableConfig tableConfig) {
+ IngestionConfig ingestionConfig = tableConfig.getIngestionConfig();
+ if (ingestionConfig == null || ingestionConfig.getBatchIngestionConfig()
== null) {
+ return null;
+ }
+ List<Map<String, String>> batchConfigMaps =
ingestionConfig.getBatchIngestionConfig().getBatchConfigMaps();
+ if (batchConfigMaps == null || batchConfigMaps.isEmpty()) {
+ return null;
+ }
+ String authToken =
batchConfigMaps.get(0).get(BatchConfigProperties.AUTH_TOKEN);
Review Comment:
Thanks, good catch. I've updated the Usage section to say the token should
only be set on the in-memory TableConfig passed to PinotSink, never on the
table config stored in the controller. The new integration test follows that
pattern: the controller's table config has no token. Happy to add a dedicated
sink parameter for the token if maintainers prefer that; I kept this PR small
for now.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]