zhoulii commented on code in PR #10850:
URL: https://github.com/apache/paimon/pull/10850#discussion_r4400435223
##########
paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java:
##########
@@ -333,6 +346,62 @@ public StreamDataTableScan newStreamScan() {
protected abstract BiConsumer<FileStoreScan, Predicate>
nonPartitionFilterConsumer();
+ /** Validate the captured schema and install caches before publishing the
runtime store. */
+ protected final FileStore<?> runtimeStore() {
+ FileStore<?> store = lazyStore;
+ if (store == null) {
+ synchronized (this) {
+ store = lazyStore;
+ if (store == null) {
+ CoreOptions options = coreOptions();
+ TableSchema runtimeSchema =
tableSchema.copy(options.toMap());
+ Set<String> dynamicOptionKeys =
+ new
HashSet<>(options.toConfiguration().dynamicOptions().keySet());
+ if (appliedDynamicOptionKeys != null) {
+ dynamicOptionKeys.addAll(appliedDynamicOptionKeys);
+ }
+ SchemaValidation.validateTableSchema(
+ withoutIcebergMirror(runtimeSchema),
dynamicOptionKeys);
+ store = createStore(runtimeSchema);
+ if (manifestCache != null) {
+ store.setManifestCache(manifestCache);
+ }
+ if (manifestSidecarCache != null) {
+ store.setManifestSidecarCache(manifestSidecarCache);
+ }
+ if (snapshotCache != null) {
+ store.setSnapshotCache(snapshotCache);
+ }
+ lazyStore = store;
+ }
+ }
+ }
+ return store;
+ }
+
+ protected abstract FileStore<?> createStore(TableSchema runtimeSchema);
+
+ @Override
+ public InnerTableRead newRead() {
+ store();
Review Comment:
Thanks for catching these, Fixed.
--
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]