Time getTime()

in asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBRowStore.java [648:669]


    Time getTime(int columnIndex, Calendar cal) throws SQLException {
        ADBDatatype valueType = getColumnType(columnIndex);
        switch (valueType) {
            case MISSING:
            case NULL:
                return null;
            case TIME:
                return toTimeFromTimeChronon(getColumnRegister(columnIndex, 0), getTimeZone(cal, tzSystem));
            case DATETIME:
                return toTimeFromDatetimeChronon(getColumnRegister(columnIndex, 0), getTimeZone(cal, tzSystem));
            case STRING:
                try {
                    LocalTime t = LocalTime.parse(getStringFromObjectStore(columnIndex)); // TODO:review
                    return toTimeFromTimeChronon(TimeUnit.NANOSECONDS.toMillis(t.toNanoOfDay()),
                            getTimeZone(cal, tzSystem));
                } catch (DateTimeParseException e) {
                    throw getErrorReporter().errorInvalidValueOfType(valueType);
                }
            default:
                throw getErrorReporter().errorUnexpectedType(valueType);
        }
    }