bda-datastore/src/main/java/gr/ntua/ece/cslab/selis/bda/datastore/connectors/DatastorePostgresqlConnector.java
public DimensionTable describe(String args) throws Exception {
        if (args.matches(""))
            throw new java.lang.UnsupportedOperationException("The EventLog is not set up in Postgres and can not be queried.");
        List<String> columnNames = new LinkedList<>();
        List<KeyValue> columnTypes = new LinkedList<>();
        try {
            Statement st = conn.getConnection().createStatement();
            // Turn use of the cursor on.
            st.setFetchSize(1000);
            ResultSet rs = st.executeQuery("select column_name, data_type from INFORMATION_SCHEMA.COLUMNS where table_name = '"+args+"';");
            while (rs.next()) {
                columnNames.add(rs.getString(1));
                columnTypes.add(new KeyValue(rs.getString(1),rs.getString(2)));
            }
            rs.close();
        } catch (SQLException e) {
            e.printStackTrace();
            conn.getConnection().rollback();
        }
        return new DimensionTable(args,
                new DimensionTableSchema(columnNames, columnTypes, ""),
                new LinkedList<>());
    }
// get column names and types for table 'args'
get column names and types for table 'args'
get column names and types for table ' args '
public DimensionTable describe(String args) throws Exception {
        if (args.matches(""))
            throw new java.lang.UnsupportedOperationException("The EventLog is not set up in Postgres and can not be queried.");
        List<String> columnNames = new LinkedList<>();
        List<KeyValue> columnTypes = new LinkedList<>();
        try {
            Statement st = conn.getConnection().createStatement();
            st.setFetchSize(1000);
            ResultSet rs = st.executeQuery("select column_name, data_type from INFORMATION_SCHEMA.COLUMNS where table_name = '"+args+"';");
            while (rs.next()) {
                columnNames.add(rs.getString(1));
                columnTypes.add(new KeyValue(rs.getString(1),rs.getString(2)));
            }
            rs.close();
        } catch (SQLException e) {
            e.printStackTrace();
            conn.getConnection().rollback();
        }
        return new DimensionTable(args,
                new DimensionTableSchema(columnNames, columnTypes, ""),
                new LinkedList<>());
    }
public DimensionTable describe ( String args ) throws Exception { if ( args . matches ( "" ) ) throw new java . lang . UnsupportedOperationException ( "The EventLog is not set up in Postgres and can not be queried." ) ; List < String > columnNames = new LinkedList < > ( ) ; List < KeyValue > columnTypes = new LinkedList < > ( ) ; try { Statement st = conn . getConnection ( ) . createStatement ( ) ; st . setFetchSize ( 1000 ) ; ResultSet rs = st . executeQuery ( "select column_name, data_type from INFORMATION_SCHEMA.COLUMNS where table_name = '" + args + "';" ) ; while ( rs . next ( ) ) { columnNames . add ( rs . getString ( 1 ) ) ; columnTypes . add ( new KeyValue ( rs . getString ( 1 ) , rs . getString ( 2 ) ) ) ; } rs . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; conn . getConnection ( ) . rollback ( ) ; } return new DimensionTable ( args , new DimensionTableSchema ( columnNames , columnTypes , "" ) , new LinkedList < > ( ) ) ; }
get column names and types for table 'args'
get column names and types for table ' args '
// Turn use of the cursor on.