-
Notifications
You must be signed in to change notification settings - Fork 3k
Core: REST Scan Planning Task Implementation #13400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.iceberg.rest; | ||
|
|
||
| import java.util.Map; | ||
| import java.util.Set; | ||
| import java.util.function.Supplier; | ||
| import org.apache.iceberg.BaseTable; | ||
| import org.apache.iceberg.ImmutableTableScanContext; | ||
| import org.apache.iceberg.TableOperations; | ||
| import org.apache.iceberg.TableScan; | ||
| import org.apache.iceberg.catalog.TableIdentifier; | ||
| import org.apache.iceberg.metrics.MetricsReporter; | ||
|
|
||
| class RESTTable extends BaseTable { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @singhpk234 The one comment I had about this is that we probably want to override all of the mutating operations and disallow/throw because a user may not know that they can't perform an update or start a transaction. This would likely surface as a file system access error which could be confusing/misleading.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you Dan, I agree, will publish a change right away
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing i realized its probably pretty late when the table api (to write iceberg metadata) will be invoked to commit to the table, because lets say in case of spark the executors would have attempted to write data files and only if they would have succeeded (non Fine grained cases) then would have sent back message to the driver whose responsibility now is to commit to table i.e generate metadata, which will not be the case. Essentially main question is do we need to block the writes upfront because we dont know if the table is protected or not, atleast this point server can reject the writes with 403 it its is indeed protected Me and @amogh-jahagirdar discussed this from spark pov if we can write an analyzer rule via iceberg spark extension, which detects that the query / df wants to do a write and then fails in the analysis phase saying write is not supported, WDYT |
||
| private final RESTClient client; | ||
| private final Supplier<Map<String, String>> headers; | ||
| private final MetricsReporter reporter; | ||
| private final ResourcePaths resourcePaths; | ||
| private final TableIdentifier tableIdentifier; | ||
| private final Set<Endpoint> supportedEndpoints; | ||
|
|
||
| RESTTable( | ||
| TableOperations ops, | ||
| String name, | ||
| MetricsReporter reporter, | ||
| RESTClient client, | ||
| Supplier<Map<String, String>> headers, | ||
| TableIdentifier tableIdentifier, | ||
| ResourcePaths resourcePaths, | ||
| Set<Endpoint> supportedEndpoints) { | ||
| super(ops, name, reporter); | ||
| this.reporter = reporter; | ||
| this.client = client; | ||
| this.headers = headers; | ||
| this.tableIdentifier = tableIdentifier; | ||
| this.resourcePaths = resourcePaths; | ||
| this.supportedEndpoints = supportedEndpoints; | ||
| } | ||
|
|
||
| @Override | ||
| public TableScan newScan() { | ||
singhpk234 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return new RESTTableScan( | ||
| this, | ||
| schema(), | ||
| ImmutableTableScanContext.builder().metricsReporter(reporter).build(), | ||
| client, | ||
| headers.get(), | ||
| operations(), | ||
| tableIdentifier, | ||
| resourcePaths, | ||
| supportedEndpoints); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.