@@ -104,11 +104,11 @@ class DefaultLocationProvider : public LocationProvider {
104104 DefaultLocationProvider (std::string_view table_location,
105105 const TableProperties& properties);
106106
107- std::string NewDataLocation (const std::string& filename) override ;
107+ std::string NewDataLocation (std::string_view filename) override ;
108108
109109 Result<std::string> NewDataLocation (const PartitionSpec& spec,
110110 const PartitionValues& partition_data,
111- const std::string& filename) override ;
111+ std::string_view filename) override ;
112112
113113 private:
114114 std::string data_location_;
@@ -120,13 +120,13 @@ DefaultLocationProvider::DefaultLocationProvider(std::string_view table_location
120120 : data_location_(
121121 LocationUtil::StripTrailingSlash (DataLocation(properties, table_location))) {}
122122
123- std::string DefaultLocationProvider::NewDataLocation (const std::string& filename) {
123+ std::string DefaultLocationProvider::NewDataLocation (std::string_view filename) {
124124 return std::format (" {}/{}" , data_location_, filename);
125125}
126126
127127Result<std::string> DefaultLocationProvider::NewDataLocation (
128128 const PartitionSpec& spec, const PartitionValues& partition_data,
129- const std::string& filename) {
129+ std::string_view filename) {
130130 ICEBERG_ASSIGN_OR_RAISE (auto partition_path, spec.PartitionPath (partition_data));
131131 return std::format (" {}/{}/{}" , data_location_, partition_path, filename);
132132}
@@ -137,11 +137,11 @@ class ObjectStoreLocationProvider : public LocationProvider {
137137 ObjectStoreLocationProvider (std::string_view table_location,
138138 const TableProperties& properties);
139139
140- std::string NewDataLocation (const std::string& filename) override ;
140+ std::string NewDataLocation (std::string_view filename) override ;
141141
142142 Result<std::string> NewDataLocation (const PartitionSpec& spec,
143143 const PartitionValues& partition_data,
144- const std::string& filename) override ;
144+ std::string_view filename) override ;
145145
146146 private:
147147 std::string storage_location_;
@@ -164,7 +164,7 @@ ObjectStoreLocationProvider::ObjectStoreLocationProvider(
164164 }
165165}
166166
167- std::string ObjectStoreLocationProvider::NewDataLocation (const std::string& filename) {
167+ std::string ObjectStoreLocationProvider::NewDataLocation (std::string_view filename) {
168168 std::string hash = ComputeHash (filename);
169169
170170 if (!context_.empty ()) {
@@ -184,7 +184,7 @@ std::string ObjectStoreLocationProvider::NewDataLocation(const std::string& file
184184
185185Result<std::string> ObjectStoreLocationProvider::NewDataLocation (
186186 const PartitionSpec& spec, const PartitionValues& partition_data,
187- const std::string& filename) {
187+ std::string_view filename) {
188188 if (include_partition_paths_) {
189189 ICEBERG_ASSIGN_OR_RAISE (auto partition_path, spec.PartitionPath (partition_data));
190190 return NewDataLocation (std::format (" {}/{}" , partition_path, filename));
0 commit comments