Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one
0003  * or more contributor license agreements.  See the NOTICE file
0004  * distributed with this work for additional information
0005  * regarding copyright ownership.  The ASF licenses this file
0006  * to you under the Apache License, Version 2.0 (the
0007  * "License"); you may not use this file except in compliance
0008  * with the License.  You may obtain a copy of the License at
0009  *
0010  *   http://www.apache.org/licenses/LICENSE-2.0
0011  *
0012  * Unless required by applicable law or agreed to in writing,
0013  * software distributed under the License is distributed on an
0014  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0015  * KIND, either express or implied.  See the License for the
0016  * specific language governing permissions and limitations
0017  * under the License.
0018  */
0019 
0020 package org.apache.parquet.filter2.predicate;
0021 
0022 import org.apache.parquet.hadoop.metadata.ColumnPath;
0023 import org.apache.parquet.filter2.predicate.Operators.BinaryColumn;
0024 import org.apache.parquet.filter2.predicate.Operators.BooleanColumn;
0025 import org.apache.parquet.filter2.predicate.Operators.DoubleColumn;
0026 import org.apache.parquet.filter2.predicate.Operators.FloatColumn;
0027 import org.apache.parquet.filter2.predicate.Operators.IntColumn;
0028 import org.apache.parquet.filter2.predicate.Operators.LongColumn;
0029 
0030 /**
0031  * TODO (PARQUET-1809): This is a temporary workaround; it is intended to be moved to Parquet.
0032  */
0033 public final class SparkFilterApi {
0034   public static IntColumn intColumn(String[] path) {
0035     return new IntColumn(ColumnPath.get(path));
0036   }
0037 
0038   public static LongColumn longColumn(String[] path) {
0039     return new LongColumn(ColumnPath.get(path));
0040   }
0041 
0042   public static FloatColumn floatColumn(String[] path) {
0043     return new FloatColumn(ColumnPath.get(path));
0044   }
0045 
0046   public static DoubleColumn doubleColumn(String[] path) {
0047     return new DoubleColumn(ColumnPath.get(path));
0048   }
0049 
0050   public static BooleanColumn booleanColumn(String[] path) {
0051     return new BooleanColumn(ColumnPath.get(path));
0052   }
0053 
0054   public static BinaryColumn binaryColumn(String[] path) {
0055     return new BinaryColumn(ColumnPath.get(path));
0056   }
0057 }