|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +install_headers( |
| 19 | + [ |
| 20 | + 'api.h', |
| 21 | + 'dataset.h', |
| 22 | + 'dataset_writer.h', |
| 23 | + 'discovery.h', |
| 24 | + 'file_base.h', |
| 25 | + 'file_csv.h', |
| 26 | + 'file_ipc.h', |
| 27 | + 'file_json.h', |
| 28 | + 'file_orc.h', |
| 29 | + 'file_parquet.h', |
| 30 | + 'parquet_encryption_config.h', |
| 31 | + 'partition.h', |
| 32 | + 'plan.h', |
| 33 | + 'projector.h', |
| 34 | + 'scanner.h', |
| 35 | + 'type_fwd.h', |
| 36 | + 'visibility.h', |
| 37 | + ], |
| 38 | + subdir: 'arrow/dataset', |
| 39 | +) |
| 40 | + |
| 41 | +arrow_dataset_srcs = [ |
| 42 | + 'dataset.cc', |
| 43 | + 'dataset_writer.cc', |
| 44 | + 'discovery.cc', |
| 45 | + 'file_base.cc', |
| 46 | + 'file_ipc.cc', |
| 47 | + 'partition.cc', |
| 48 | + 'plan.cc', |
| 49 | + 'projector.cc', |
| 50 | + 'scanner.cc', |
| 51 | + 'scan_node.cc', |
| 52 | +] |
| 53 | + |
| 54 | +if needs_csv |
| 55 | + arrow_dataset_srcs += ['file_csv.cc'] |
| 56 | +endif |
| 57 | + |
| 58 | +if needs_json |
| 59 | + arrow_dataset_srcs += ['file_json.cc'] |
| 60 | +endif |
| 61 | + |
| 62 | +# requires https://github.com/apache/arrow/pull/46409 |
| 63 | +#if needs_orc |
| 64 | +# arrow_dataset_srcs += ['file_orc.cc'] |
| 65 | +#endif |
| 66 | + |
| 67 | +# requires https://github.com/apache/arrow/issues/46410 |
| 68 | +# if needs_parquet |
| 69 | +# arrow_dataset_srcs += ['file_parquet.cc'] |
| 70 | +# endif |
| 71 | + |
| 72 | +arrow_dataset_lib = library( |
| 73 | + 'arrow-dataset', |
| 74 | + sources: arrow_dataset_srcs, |
| 75 | + dependencies: [arrow_dep, arrow_acero_dep], |
| 76 | +) |
| 77 | + |
| 78 | +arrow_dataset_testing_srcs = files('test_util_internal.cc') |
| 79 | + |
| 80 | +arrow_dataset_tests = { |
| 81 | + 'dataset-test': {'sources': ['dataset_test.cc']}, |
| 82 | + 'dataset-writer-test': {'sources': ['dataset_writer_test.cc']}, |
| 83 | + 'discovery-test': {'sources': ['discovery_test.cc']}, |
| 84 | + 'file-ipc-test': {'sources': ['file_ipc_test.cc']}, |
| 85 | + 'file-test': {'sources': ['file_test.cc'] + arrow_acero_testing_sources}, |
| 86 | + 'partition-test': {'sources': ['partition_test.cc']}, |
| 87 | + 'scanner-test': {'sources': ['scanner_test.cc']}, |
| 88 | + 'subtree-test': {'sources': ['subtree_test.cc']}, |
| 89 | + 'write-node-test': {'sources': ['write_node_test.cc']}, |
| 90 | +} |
| 91 | +arrow_dataset_test_deps = [] |
| 92 | + |
| 93 | +if needs_csv |
| 94 | + arrow_dataset_tests += {'file-csv-test': {'sources': ['file_csv_test.cc']}} |
| 95 | +endif |
| 96 | + |
| 97 | +if needs_json |
| 98 | + arrow_dataset_tests += { |
| 99 | + 'file-json-test': { |
| 100 | + 'sources': ['file_json_test.cc'], |
| 101 | + 'dependencies': [rapidjson_dep], |
| 102 | + }, |
| 103 | + } |
| 104 | +endif |
| 105 | + |
| 106 | + |
| 107 | +# requires https://github.com/apache/arrow/pull/46409 |
| 108 | +#if needs_orc |
| 109 | +# arrow_dataset_test_srcs += ['file_orc_test'] |
| 110 | +# arrow_dataset_test_deps += orc_dep |
| 111 | +#endif |
| 112 | + |
| 113 | +# requires https://github.com/apache/arrow/issues/46410 |
| 114 | +# if needs_parquet |
| 115 | +# arrow_dataset_test_srcs += ['file_parquet_test'] |
| 116 | +# if needs_parquet_encryption |
| 117 | +# ... |
| 118 | +# endif |
| 119 | +# endif |
| 120 | + |
| 121 | +foreach key, val : arrow_dataset_tests |
| 122 | + exc = executable( |
| 123 | + 'arrow-dataset-@0@'.format(key), |
| 124 | + sources: val['sources'] + arrow_dataset_testing_srcs, |
| 125 | + dependencies: [ |
| 126 | + arrow_acero_dep, |
| 127 | + arrow_test_dep, |
| 128 | + val.get('dependencies', []), |
| 129 | + ], |
| 130 | + link_with: arrow_dataset_lib, |
| 131 | + ) |
| 132 | + test('arrow-dataset-@0@'.format(key), exc) |
| 133 | +endforeach |
| 134 | + |
| 135 | +arrow_dataset_benchmarks = ['file_benchmark', 'scanner_benchmark'] |
| 136 | + |
| 137 | +foreach arrow_dataset_benchmark : arrow_dataset_benchmarks |
| 138 | + exc = executable( |
| 139 | + 'arrow-dataset-@0@'.format(arrow_dataset_benchmark.replace('_', '-')), |
| 140 | + sources: '@[email protected]'.format(arrow_dataset_benchmark), |
| 141 | + dependencies: [arrow_acero_dep, arrow_benchmark_dep, gmock_dep], |
| 142 | + link_with: arrow_dataset_lib, |
| 143 | + ) |
| 144 | +endforeach |
0 commit comments