@@ -0,0 +1,2349 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.facebook.presto.benchmark;%0A%0Aimport com.facebook.presto.testing.LocalQueryRunner;%0A%0Aimport static com.facebook.presto.benchmark.BenchmarkQueryRunner.createLocalQueryRunner;%0A%0Apublic class StructuredTypesBenchmark%0A        extends AbstractSqlBenchmark%0A%7B%0A    // Benchmark is modeled after TPCH query 1, with array/map creation added in%0A    public StructuredTypesBenchmark(LocalQueryRunner localQueryRunner)%0A    %7B%0A        super(localQueryRunner, %22structured_types%22, 4, 5, %22%22 +%0A                %22select%5Cn%22 +%0A                %22    returnflag,%5Cn%22 +%0A                %22    linestatus,%5Cn%22 +%0A                %22    sum(array%5Bquantity%5D%5B1%5D) as sum_qty,%5Cn%22 +%0A                %22    sum(array%5Bextendedprice%5D%5B1%5D) as sum_base_price,%5Cn%22 +%0A                %22    sum(array%5Bextendedprice%5D%5B1%5D * (1 - map(array%5B'key'%5D, array%5Bdiscount%5D)%5B'key'%5D)) as sum_disc_price,%5Cn%22 +%0A                %22    sum(array%5Bextendedprice%5D%5B1%5D * (1 - map(array%5B'key'%5D, array%5Bdiscount%5D)%5B'key'%5D) * (1 + tax)) as sum_charge,%5Cn%22 +%0A                %22    avg(map(array%5B'key'%5D, array%5Bquantity%5D)%5B'key'%5D) as avg_qty,%5Cn%22 +%0A                %22    avg(map(array%5B'key'%5D, array%5Bextendedprice%5D)%5B'key'%5D) as avg_price,%5Cn%22 +%0A                %22    avg(map(array%5B'key'%5D, array%5Bdiscount%5D)%5B'key'%5D) as avg_disc%5Cn%22 +%0A                %22from%5Cn%22 +%0A                %22    lineitem%5Cn%22 +%0A                %22where%5Cn%22 +%0A                %22    shipdate %3C= DATE '1998-09-02'%5Cn%22 +%0A                %22group by%5Cn%22 +%0A                %22    returnflag,%5Cn%22 +%0A                %22    linestatus%5Cn%22 +%0A                %22order by%5Cn%22 +%0A                %22    returnflag,%5Cn%22 +%0A                %22    linestatus%22);%0A    %7D%0A%0A    public static void main(String%5B%5D args)%0A    %7B%0A        new StructuredTypesBenchmark(createLocalQueryRunner()).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out));%0A    %7D%0A%7D%0A

Add benchmark for structured types