@@ -0,0 +1,1921 @@
+/**%0A * Copyright (C) 2013-2020 Klarna AB%0A *%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.klarna.hiverunner;%0A%0Aimport com.klarna.hiverunner.annotations.HiveSQL;%0Aimport com.klarna.hiverunner.annotations.HiveSetupScript;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport java.util.Arrays;%0A%0A/**%0A * Methods that set up data in HiveRunner use HCatalog, which initially did not support writing to Parquet files.%0A *%0A * A version of HCatalog with this functionality working was introduced in Hive 3.%0A * It was also subsequently back-ported to Hive 2.3.7, which is used in HiveRunner %3E= 5.2.0.%0A *%0A * This test validates that Parquet insertion is now possible. It has been verified to fail on HiveRunner %3C= 5.1.x.%0A */%0A@RunWith(StandaloneHiveRunner.class)%0Apublic class ParquetInsertionTest %7B%0A%0A    @HiveSQL(files = %7B%7D)%0A    private HiveShell hiveShell;%0A%0A    private static final String TABLE_NAME = %22parquet_test_table%22;%0A%0A    @HiveSetupScript%0A    private static final String CREATE_TABLE_SCRIPT = %22CREATE TABLE %22 + TABLE_NAME + %22 (col1 string) STORED AS PARQUET;%22;%0A%0A    @Test%0A    public void testCanInsertToParquetTable() %7B%0A        String textValue = %22Some text value%22;%0A        hiveShell.insertInto(%22default%22, TABLE_NAME).addRow(textValue).commit();%0A        Assert.assertEquals(hiveShell.executeQuery(%22SELECT col1 FROM %22 + TABLE_NAME), Arrays.asList(textValue));%0A    %7D%0A%0A%7D%0A

Add test to verify insertion to Parquet tables works in HiveRunner >= 5.2.0 (#122)