iceberg-cpp
Loading...
Searching...
No Matches
location_provider.h
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
22#include <memory>
23#include <string>
24#include <string_view>
25
26#include "iceberg/iceberg_export.h"
27#include "iceberg/result.h"
28#include "iceberg/type_fwd.h"
29
30namespace iceberg {
31
33class ICEBERG_EXPORT LocationProvider {
34 public:
35 virtual ~LocationProvider() = default;
36
41 virtual std::string NewDataLocation(std::string_view filename) = 0;
42
50 virtual Result<std::string> NewDataLocation(const PartitionSpec& spec,
51 const PartitionValues& partition,
52 std::string_view filename) = 0;
53
59 static Result<std::unique_ptr<LocationProvider>> Make(
60 std::string_view location, const TableProperties& properties);
61};
62
63} // namespace iceberg
Interface for providing data file locations.
Definition location_provider.h:33
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.
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:37