// Path: src/main/java/com/qubole/presto/kinesis/decoder/dummy/DummyKinesisRowDecoder.java
// public class DummyKinesisRowDecoder
//         implements KinesisRowDecoder
// {
//     public static final String NAME = "dummy";
// 
//     @Override
//     public String getName()
//     {
//         return NAME;
//     }
// 
//     @Override
//     public boolean decodeRow(byte[] data,
//             Set<KinesisFieldValueProvider> fieldValueProviders,
//             List<KinesisColumnHandle> columnHandles,
//             Map<KinesisColumnHandle, KinesisFieldDecoder<?>> fieldDecoders)
//     {
//         return true;
//     }
// }


import static com.google.common.base.Preconditions.checkNotNull;
import com.facebook.presto.spi.ColumnHandle;
import com.facebook.presto.spi.ColumnMetadata;
import com.facebook.presto.spi.ConnectorSession;
import com.facebook.presto.spi.ConnectorTableMetadata;
import com.facebook.presto.spi.Constraint;
import com.facebook.presto.spi.SchemaTableName;
import com.facebook.presto.spi.SchemaTablePrefix;
import com.facebook.presto.spi.TableNotFoundException;
import com.facebook.presto.spi.ConnectorTableLayoutResult;
import com.facebook.presto.spi.ConnectorTableHandle;
import com.facebook.presto.spi.ConnectorTableLayout;
import com.facebook.presto.spi.ConnectorTableLayoutHandle;
import io.airlift.log.Logger;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import com.qubole.presto.kinesis.decoder.dummy.DummyKinesisRowDecoder;
import com.facebook.presto.spi.connector.ConnectorMetadata;
import com.google.common.annotations.VisibleForTesting;
import java.util.function.Supplier;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Inject;
import com.google.inject.name.Named;
    }

    @Override
    public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
    {
        checkNotNull(prefix, "prefix is null");
        log.debug("Called listTableColumns on %s.%s", prefix.getSchemaName(), prefix.getTableName());

        ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder();

        // NOTE: prefix.getTableName or prefix.getSchemaName can be null
        List<SchemaTableName> tableNames;
        if (prefix.getSchemaName() != null && prefix.getTableName() != null) {
            tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
        }
        else {
            tableNames = listTables(session, (String) null);
        }

        for (SchemaTableName tableName : tableNames) {
            ConnectorTableMetadata tableMetadata = getTableMetadata(tableName);
            if (tableMetadata != null) {
                columns.put(tableName, tableMetadata.getColumns());
            }
        }
        return columns.build();
    }

    private static String getDataFormat(KinesisStreamFieldGroup fieldGroup)
    {
// Path: src/main/java/com/qubole/presto/kinesis/decoder/dummy/DummyKinesisRowDecoder.java
// public class DummyKinesisRowDecoder
//         implements KinesisRowDecoder
// {
//     public static final String NAME = "dummy";
// 
//     @Override
//     public String getName()
//     {
//         return NAME;
//     }
// 
//     @Override
//     public boolean decodeRow(byte[] data,
//             Set<KinesisFieldValueProvider> fieldValueProviders,
//             List<KinesisColumnHandle> columnHandles,
//             Map<KinesisColumnHandle, KinesisFieldDecoder<?>> fieldDecoders)
//     {
//         return true;
//     }
// }


// Path: src/main/java/com/qubole/presto/kinesis/KinesisMetadata.java
import static com.google.common.base.Preconditions.checkNotNull;
import com.facebook.presto.spi.ColumnHandle;
import com.facebook.presto.spi.ColumnMetadata;
import com.facebook.presto.spi.ConnectorSession;
import com.facebook.presto.spi.ConnectorTableMetadata;
import com.facebook.presto.spi.Constraint;
import com.facebook.presto.spi.SchemaTableName;
import com.facebook.presto.spi.SchemaTablePrefix;
import com.facebook.presto.spi.TableNotFoundException;
import com.facebook.presto.spi.ConnectorTableLayoutResult;
import com.facebook.presto.spi.ConnectorTableHandle;
import com.facebook.presto.spi.ConnectorTableLayout;
import com.facebook.presto.spi.ConnectorTableLayoutHandle;
import io.airlift.log.Logger;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import com.qubole.presto.kinesis.decoder.dummy.DummyKinesisRowDecoder;
import com.facebook.presto.spi.connector.ConnectorMetadata;
import com.google.common.annotations.VisibleForTesting;
import java.util.function.Supplier;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Inject;
import com.google.inject.name.Named;

    }

    @Override
    public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
    {
        checkNotNull(prefix, "prefix is null");
        log.debug("Called listTableColumns on %s.%s", prefix.getSchemaName(), prefix.getTableName());

        ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder();

        // NOTE: prefix.getTableName or prefix.getSchemaName can be null
        List<SchemaTableName> tableNames;
        if (prefix.getSchemaName() != null && prefix.getTableName() != null) {
            tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
        }
        else {
            tableNames = listTables(session, (String) null);
        }

        for (SchemaTableName tableName : tableNames) {
            ConnectorTableMetadata tableMetadata = getTableMetadata(tableName);
            if (tableMetadata != null) {
                columns.put(tableName, tableMetadata.getColumns());
            }
        }
        return columns.build();
    }

    private static String getDataFormat(KinesisStreamFieldGroup fieldGroup)
    {
        return (fieldGroup == null) ? DummyKinesisRowDecoder.NAME : fieldGroup.getDataFormat();