iceberg-cpp
Loading...
Searching...
No Matches
location_provider.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
24
25#include <memory>
26#include <string>
27#include <string_view>
28
30#include "iceberg/result.h"
31#include "iceberg/type_fwd.h"
32
33namespace iceberg {
34
36class ICEBERG_EXPORT LocationProvider {
37 public:
38 virtual ~LocationProvider() = default;
39
44 virtual std::string NewDataLocation(std::string_view filename) = 0;
45
54 const PartitionValues& partition,
55 std::string_view filename) = 0;
56
63 std::string_view location, const TableProperties& properties);
64};
65
66} // namespace iceberg
Interface for providing data file locations.
Definition location_provider.h:36
virtual std::string NewDataLocation(std::string_view filename)=0
Return a fully-qualified data file location for the given filename.
virtual Result< std::string > NewDataLocation(const PartitionSpec &spec, const PartitionValues &partition, std::string_view filename)=0
Return a fully-qualified data file location for the given partition and filename.
static Result< std::unique_ptr< LocationProvider > > Make(std::string_view location, const TableProperties &properties)
Create a LocationProvider for the given table location and properties.
A partition spec for a Table.
Definition partition_spec.h:47
StructLike wrapper for a vector of literals that represent partition values.
Definition partition_values.h:36
Table properties for Iceberg tables.
Definition table_properties.h:40
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.