Skip to content

Commit 09175f3

Browse files
BryanCutleraditi-pandit
authored andcommitted
Fix protocol generation to properly remove license
The java-to-struct-json.py script was supposed to remove the license header from special classes ending in .inc so they can be inserted in protocol definition sources. It was incorrectly using the Velox license header, which is slightly different, and never removed the license. This uses the correct license.header file from presto_cpp so it is removed from special classes when generating the presto protocol.
1 parent 941ffb2 commit 09175f3

File tree

8 files changed

+1
-619
lines changed

8 files changed

+1
-619
lines changed

presto-native-execution/presto_cpp/presto_protocol/connector/arrow_flight/presto_protocol_arrow_flight.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,6 @@ void to_json(json& j, const ArrowTransactionHandle& p);
3838
void from_json(const json& j, ArrowTransactionHandle& p);
3939

4040
} // namespace facebook::presto::protocol::arrow_flight
41-
/*
42-
* Licensed under the Apache License, Version 2.0 (the "License");
43-
* you may not use this file except in compliance with the License.
44-
* You may obtain a copy of the License at
45-
*
46-
* http://www.apache.org/licenses/LICENSE-2.0
47-
*
48-
* Unless required by applicable law or agreed to in writing, software
49-
* distributed under the License is distributed on an "AS IS" BASIS,
50-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51-
* See the License for the specific language governing permissions and
52-
* limitations under the License.
53-
*/
54-
5541
// ArrowColumnHandle is special since it needs an implementation of
5642
// operator<().
5743

presto-native-execution/presto_cpp/presto_protocol/connector/hive/presto_protocol_hive.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -869,19 +869,6 @@ void from_json(const json& j, Table& p) {
869869
"viewExpandedText");
870870
}
871871
} // namespace facebook::presto::protocol::hive
872-
/*
873-
* Licensed under the Apache License, Version 2.0 (the "License");
874-
* you may not use this file except in compliance with the License.
875-
* You may obtain a copy of the License at
876-
*
877-
* http://www.apache.org/licenses/LICENSE-2.0
878-
*
879-
* Unless required by applicable law or agreed to in writing, software
880-
* distributed under the License is distributed on an "AS IS" BASIS,
881-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
882-
* See the License for the specific language governing permissions and
883-
* limitations under the License.
884-
*/
885872
namespace facebook::presto::protocol::hive {
886873

887874
void to_json(json& j, const HivePageSinkMetadata& p) {
@@ -907,19 +894,6 @@ void from_json(const json& j, HivePageSinkMetadata& p) {
907894
from_json_key(j, "table", p.table, "HivePageSinkMetadata", "Table", "table");
908895
}
909896
} // namespace facebook::presto::protocol::hive
910-
/*
911-
* Licensed under the Apache License, Version 2.0 (the "License");
912-
* you may not use this file except in compliance with the License.
913-
* You may obtain a copy of the License at
914-
*
915-
* http://www.apache.org/licenses/LICENSE-2.0
916-
*
917-
* Unless required by applicable law or agreed to in writing, software
918-
* distributed under the License is distributed on an "AS IS" BASIS,
919-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
920-
* See the License for the specific language governing permissions and
921-
* limitations under the License.
922-
*/
923897
namespace facebook::presto::protocol::hive {
924898

925899
static const std::pair<HiveStorageFormat, json> HiveStorageFormat_enum_table[] =

presto-native-execution/presto_cpp/presto_protocol/connector/hive/presto_protocol_hive.h

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,6 @@ enum class ColumnType { PARTITION_KEY, REGULAR, SYNTHESIZED, AGGREGATED };
2929
extern void to_json(json& j, const ColumnType& e);
3030
extern void from_json(const json& j, ColumnType& e);
3131
} // namespace facebook::presto::protocol::hive
32-
/*
33-
* Licensed under the Apache License, Version 2.0 (the "License");
34-
* you may not use this file except in compliance with the License.
35-
* You may obtain a copy of the License at
36-
*
37-
* http://www.apache.org/licenses/LICENSE-2.0
38-
*
39-
* Unless required by applicable law or agreed to in writing, software
40-
* distributed under the License is distributed on an "AS IS" BASIS,
41-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42-
* See the License for the specific language governing permissions and
43-
* limitations under the License.
44-
*/
45-
4632
// HiveColumnHandle is special since it needs an implementation of
4733
// operator<().
4834

@@ -208,20 +194,6 @@ struct Table {
208194
void to_json(json& j, const Table& p);
209195
void from_json(const json& j, Table& p);
210196
} // namespace facebook::presto::protocol::hive
211-
/*
212-
* Licensed under the Apache License, Version 2.0 (the "License");
213-
* you may not use this file except in compliance with the License.
214-
* You may obtain a copy of the License at
215-
*
216-
* http://www.apache.org/licenses/LICENSE-2.0
217-
*
218-
* Unless required by applicable law or agreed to in writing, software
219-
* distributed under the License is distributed on an "AS IS" BASIS,
220-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
221-
* See the License for the specific language governing permissions and
222-
* limitations under the License.
223-
*/
224-
225197
// dependency Table
226198
// dependency SchemaTableName
227199

@@ -236,20 +208,6 @@ void to_json(json& j, const HivePageSinkMetadata& p);
236208
void from_json(const json& j, HivePageSinkMetadata& p);
237209

238210
} // namespace facebook::presto::protocol::hive
239-
/*
240-
* Licensed under the Apache License, Version 2.0 (the "License");
241-
* you may not use this file except in compliance with the License.
242-
* You may obtain a copy of the License at
243-
*
244-
* http://www.apache.org/licenses/LICENSE-2.0
245-
*
246-
* Unless required by applicable law or agreed to in writing, software
247-
* distributed under the License is distributed on an "AS IS" BASIS,
248-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
249-
* See the License for the specific language governing permissions and
250-
* limitations under the License.
251-
*/
252-
253211
namespace facebook::presto::protocol::hive {
254212

255213
enum class HiveStorageFormat {

presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.h

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,6 @@ struct ColumnIdentity {
4343
void to_json(json& j, const ColumnIdentity& p);
4444
void from_json(const json& j, ColumnIdentity& p);
4545
} // namespace facebook::presto::protocol::iceberg
46-
/*
47-
* Licensed under the Apache License, Version 2.0 (the "License");
48-
* you may not use this file except in compliance with the License.
49-
* You may obtain a copy of the License at
50-
*
51-
* http://www.apache.org/licenses/LICENSE-2.0
52-
*
53-
* Unless required by applicable law or agreed to in writing, software
54-
* distributed under the License is distributed on an "AS IS" BASIS,
55-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
56-
* See the License for the specific language governing permissions and
57-
* limitations under the License.
58-
*/
59-
6046
// IcebergColumnHandle is special since it needs an implementation of
6147
// operator<().
6248

@@ -181,20 +167,6 @@ struct SortField {
181167
void to_json(json& j, const SortField& p);
182168
void from_json(const json& j, SortField& p);
183169
} // namespace facebook::presto::protocol::iceberg
184-
/*
185-
* Licensed under the Apache License, Version 2.0 (the "License");
186-
* you may not use this file except in compliance with the License.
187-
* You may obtain a copy of the License at
188-
*
189-
* http://www.apache.org/licenses/LICENSE-2.0
190-
*
191-
* Unless required by applicable law or agreed to in writing, software
192-
* distributed under the License is distributed on an "AS IS" BASIS,
193-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194-
* See the License for the specific language governing permissions and
195-
* limitations under the License.
196-
*/
197-
198170
// IcebergInsertTableHandle is special since it needs an usage of
199171
// hive::.
200172

@@ -216,20 +188,6 @@ struct IcebergInsertTableHandle : public ConnectorInsertTableHandle {
216188
void to_json(json& j, const IcebergInsertTableHandle& p);
217189
void from_json(const json& j, IcebergInsertTableHandle& p);
218190
} // namespace facebook::presto::protocol::iceberg
219-
/*
220-
* Licensed under the Apache License, Version 2.0 (the "License");
221-
* you may not use this file except in compliance with the License.
222-
* You may obtain a copy of the License at
223-
*
224-
* http://www.apache.org/licenses/LICENSE-2.0
225-
*
226-
* Unless required by applicable law or agreed to in writing, software
227-
* distributed under the License is distributed on an "AS IS" BASIS,
228-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
229-
* See the License for the specific language governing permissions and
230-
* limitations under the License.
231-
*/
232-
233191
// IcebergInsertTableHandle is special since it needs an usage of
234192
// hive::.
235193

@@ -251,20 +209,6 @@ struct IcebergOutputTableHandle : public ConnectorOutputTableHandle {
251209
void to_json(json& j, const IcebergOutputTableHandle& p);
252210
void from_json(const json& j, IcebergOutputTableHandle& p);
253211
} // namespace facebook::presto::protocol::iceberg
254-
/*
255-
* Licensed under the Apache License, Version 2.0 (the "License");
256-
* you may not use this file except in compliance with the License.
257-
* You may obtain a copy of the License at
258-
*
259-
* http://www.apache.org/licenses/LICENSE-2.0
260-
*
261-
* Unless required by applicable law or agreed to in writing, software
262-
* distributed under the License is distributed on an "AS IS" BASIS,
263-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
264-
* See the License for the specific language governing permissions and
265-
* limitations under the License.
266-
*/
267-
268212
// IcebergSplit is special since it needs an usage of
269213
// hive::.
270214

presto-native-execution/presto_cpp/presto_protocol/connector/tpch/presto_protocol_tpch.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,6 @@ void to_json(json& j, const TpchTransactionHandle& p);
3030

3131
void from_json(const json& j, TpchTransactionHandle& p);
3232
} // namespace facebook::presto::protocol::tpch
33-
/*
34-
* Licensed under the Apache License, Version 2.0 (the "License");
35-
* you may not use this file except in compliance with the License.
36-
* You may obtain a copy of the License at
37-
*
38-
* http://www.apache.org/licenses/LICENSE-2.0
39-
*
40-
* Unless required by applicable law or agreed to in writing, software
41-
* distributed under the License is distributed on an "AS IS" BASIS,
42-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
43-
* See the License for the specific language governing permissions and
44-
* limitations under the License.
45-
*/
46-
4733
// TpchColumnHandle is special since it needs an implementation of
4834
// operator<().
4935

0 commit comments

Comments
 (0)