| 825 | }; |
| 826 | |
| 827 | int main(int argc, char** argv) { |
| 828 | int mode = argc > 1 ? std::atoi(argv[2]) : SOURCE_SINK; |
| 829 | std::string base_save_path = argc > 2 ? argv[2] : ""; |
| 830 | arrow::Status status = arrow::compute::Initialize(); |
| 831 | if (!status.ok()) { |
| 832 | std::cout << "Error occurred: " << status.message() << std::endl; |
| 833 | return EXIT_FAILURE; |
| 834 | } |
| 835 | // ensure arrow::dataset node factories are in the registry |
| 836 | arrow::dataset::internal::Initialize(); |
| 837 | switch (mode) { |
| 838 | case SOURCE_SINK: |
| 839 | PrintBlock("Source Sink Example"); |
| 840 | status = SourceSinkExample(); |
| 841 | break; |
| 842 | case TABLE_SOURCE_SINK: |
| 843 | PrintBlock("Table Source Sink Example"); |
| 844 | status = TableSourceSinkExample(); |
| 845 | break; |
| 846 | case SCAN: |
| 847 | PrintBlock("Scan Example"); |
| 848 | status = ScanSinkExample(); |
| 849 | break; |
| 850 | case FILTER: |
| 851 | PrintBlock("Filter Example"); |
| 852 | status = ScanFilterSinkExample(); |
| 853 | break; |
| 854 | case PROJECT: |
| 855 | PrintBlock("Project Example"); |
| 856 | status = ScanProjectSinkExample(); |
| 857 | break; |
| 858 | case PROJECT_SEQUENCE: |
| 859 | PrintBlock("Project Example (using Declaration::Sequence)"); |
| 860 | status = ScanProjectSequenceSinkExample(); |
| 861 | break; |
| 862 | case GROUP_AGGREGATION: |
| 863 | PrintBlock("Aggregate Example"); |
| 864 | status = SourceGroupAggregateSinkExample(); |
| 865 | break; |
| 866 | case SCALAR_AGGREGATION: |
| 867 | PrintBlock("Aggregate Example"); |
| 868 | status = SourceScalarAggregateSinkExample(); |
| 869 | break; |
| 870 | case CONSUMING_SINK: |
| 871 | PrintBlock("Consuming-Sink Example"); |
| 872 | status = SourceConsumingSinkExample(); |
| 873 | break; |
| 874 | case ORDER_BY_SINK: |
| 875 | PrintBlock("OrderBy Example"); |
| 876 | status = SourceOrderBySinkExample(); |
| 877 | break; |
| 878 | case HASHJOIN: |
| 879 | PrintBlock("HashJoin Example"); |
| 880 | status = SourceHashJoinSinkExample(); |
| 881 | break; |
| 882 | case KSELECT: |
| 883 | PrintBlock("KSelect Example"); |
| 884 | status = SourceKSelectExample(); |
nothing calls this directly
no test coverage detected