/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package integrationtests;

import io.airlift.log.Logger;

import org.testng.annotations.Test;

import com.facebook.presto.dynamo.DynamoQueryRunner;
import com.facebook.presto.testing.MaterializedResult;
import com.facebook.presto.testing.MaterializedRow;
import com.facebook.presto.tests.AbstractTestIntegrationSmokeTest;

@Test(singleThreaded = true)
public class DynamoSqlQueryITCase extends AbstractTestIntegrationSmokeTest
{
    private static final Logger log = Logger.get(DynamoSqlQueryITCase.class);

    public DynamoSqlQueryITCase() throws Exception
    {
        super(DynamoQueryRunner.createDynamoQueryRunner(),
                DynamoQueryRunner.createSession());
    }

    @Test
    public void testQuery()
    {
        {
            MaterializedResult result = queryRunner.execute(
                    DynamoQueryRunner.createDynamoSession("us_west_2"),
                    "select * from us_west_2.users limit 10");
            printMaterializedResult(result);
        }
        {
            MaterializedResult result = queryRunner.execute(
                DynamoQueryRunner.createDynamoSession("US_WEST_2"),
                "select * from US_WEST_2.Users limit 10");
            printMaterializedResult(result);
        }
        {
            MaterializedResult result = queryRunner.execute(
                DynamoQueryRunner.createDynamoSession("us_west_2"),
                "select * from us_west_2.users limit 10");
            printMaterializedResult(result);
        }
    }

    private static void printMaterializedResult(MaterializedResult result)
    {
        int rowIndex = 0;
        for (MaterializedRow row : result) {
            log.info(String.format("---------- Row %s with %s fields---------", rowIndex++, row.getFieldCount()));
            for (int i = 0; i < row.getFieldCount(); i++) {
                Object obj = row.getField(i);
                log.info("Field %s: %s", i, obj);
            }
        }
    }
}

@@ -582,16 +582,68 @@
 tests;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 import i
@@ -698,24 +698,61 @@
 ions.Test;%0A%0A
+import com.beust.jcommander.Strings;%0A
 import com.f
@@ -944,36 +944,30 @@
 ractTest
-IntegrationSmokeTest
+QueryFramework
 ;%0A%0A@Test
@@ -1048,28 +1048,22 @@
 Test
-IntegrationSmokeTest
+QueryFramework
 %0A%7B%0A 
@@ -1258,59 +1258,8 @@
 er()
-,%0A                DynamoQueryRunner.createSession()
 );%0A 
@@ -2345,24 +2345,81 @@
 dCount()));%0A
+            List%3CString%3E list = new ArrayList%3CString%3E();%0A
             
@@ -2512,24 +2512,81 @@
 eld(i);%0A    
+            list.add(String.valueOf(obj));%0A            %7D%0A
             
@@ -2605,17 +2605,21 @@
 eld 
-%25
+value
 s: %25s%22, 
 i, o
@@ -2618,30 +2618,33 @@
 s%22, 
-i, obj);%0A            %7D
+String.join(%22, %22, list));
 %0A   

Update test