target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test(expected=NullPointerException.class) public void testNullCalendar() throws InvalidAccessException { accessor.getDate(0, null); } | @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); @... | DateMilliAccessor extends AbstractSqlAccessor { @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); @... |
@Test public void testGetDate() throws Exception { assertEquals(new Date(72, 10, 3), accessor.getDate(0, PST_CALENDAR)); assertEquals(new Date(72, 10, 4), accessor.getDate(0, UTC_CALENDAR)); assertEquals(new Date(119, 4, 27), accessor.getDate(1, PST_CALENDAR)); assertEquals(new Date(119, 4, 27), accessor.getDate(1, UTC... | @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); @... | DateMilliAccessor extends AbstractSqlAccessor { @Override public Date getDate(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve date."); return getDate(index, calendar.getTimeZone()); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); @... |
@Test public void testIsNull() throws Exception { assertFalse(genericAccessor.isNull(0)); assertTrue(genericAccessor.isNull(1)); } | @Override public boolean isNull(int index) { return v.isNull(index); } | GenericAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return v.isNull(index); } } | GenericAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return v.isNull(index); } GenericAccessor(ValueVector v); } | GenericAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return v.isNull(index); } GenericAccessor(ValueVector v); @Override Class<?> getObjectClass(); @Override boolean isNull(int index); @Override Object getObject(int index); @Override MajorType getType(); } | GenericAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return v.isNull(index); } GenericAccessor(ValueVector v); @Override Class<?> getObjectClass(); @Override boolean isNull(int index); @Override Object getObject(int index); @Override MajorType getType(); } |
@Test public void testGetObject() throws Exception { assertEquals(NON_NULL_VALUE, genericAccessor.getObject(0)); assertNull(genericAccessor.getObject(1)); } | @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } | GenericAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } } | GenericAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } GenericAccessor(ValueVector v); } | GenericAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } GenericAccessor(ValueVector v); @Override Class<?> getObjectClass(); @Override boolean isNull(int index); @Override Object getObject(int index); @Override MajorType get... | GenericAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } GenericAccessor(ValueVector v); @Override Class<?> getObjectClass(); @Override boolean isNull(int index); @Override Object getObject(int index); @Override MajorType get... |
@Test(expected=IndexOutOfBoundsException.class) public void testGetObject_indexOutOfBounds() throws Exception { genericAccessor.getObject(2); } | @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } | GenericAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } } | GenericAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } GenericAccessor(ValueVector v); } | GenericAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } GenericAccessor(ValueVector v); @Override Class<?> getObjectClass(); @Override boolean isNull(int index); @Override Object getObject(int index); @Override MajorType get... | GenericAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) throws InvalidAccessException { return v.getObject(index); } GenericAccessor(ValueVector v); @Override Class<?> getObjectClass(); @Override boolean isNull(int index); @Override Object getObject(int index); @Override MajorType get... |
@Test public void testGetType() throws Exception { assertEquals(UserBitShared.SerializedField.getDefaultInstance().getMajorType(), genericAccessor.getType()); } | @Override public MajorType getType() { return getMajorTypeForField(v.getField()); } | GenericAccessor extends AbstractSqlAccessor { @Override public MajorType getType() { return getMajorTypeForField(v.getField()); } } | GenericAccessor extends AbstractSqlAccessor { @Override public MajorType getType() { return getMajorTypeForField(v.getField()); } GenericAccessor(ValueVector v); } | GenericAccessor extends AbstractSqlAccessor { @Override public MajorType getType() { return getMajorTypeForField(v.getField()); } GenericAccessor(ValueVector v); @Override Class<?> getObjectClass(); @Override boolean isNull(int index); @Override Object getObject(int index); @Override MajorType getType(); } | GenericAccessor extends AbstractSqlAccessor { @Override public MajorType getType() { return getMajorTypeForField(v.getField()); } GenericAccessor(ValueVector v); @Override Class<?> getObjectClass(); @Override boolean isNull(int index); @Override Object getObject(int index); @Override MajorType getType(); } |
@Test public void testIsNull() throws Exception { assertNotNull(accessor.getObject(0)); assertNotNull(accessor.getTimestamp(0, PST_CALENDAR)); assertNull(accessor.getObject(2)); assertNull(accessor.getTimestamp(2, PST_CALENDAR)); } | @Override public boolean isNull(int index) { return ac.isNull(index); } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } TimeStampMilliAccessor(TimeStampMilliVector vector, TimeZone defaultTZ); } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } TimeStampMilliAccessor(TimeStampMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Object ... | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } TimeStampMilliAccessor(TimeStampMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Object ... |
@Test public void testGetObject() throws Exception { assertEquals( new Timestamp(72, 10, 4, 11, 10, 8, (int)TimeUnit.MILLISECONDS.toNanos(957)), accessor.getObject(0)); } | @Override public Object getObject(int index) { return getTimestamp(index, defaultTimeZone); } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getTimestamp(index, defaultTimeZone); } } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getTimestamp(index, defaultTimeZone); } TimeStampMilliAccessor(TimeStampMilliVector vector, TimeZone defaultTZ); } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getTimestamp(index, defaultTimeZone); } TimeStampMilliAccessor(TimeStampMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClas... | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getTimestamp(index, defaultTimeZone); } TimeStampMilliAccessor(TimeStampMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClas... |
@Test(expected=NullPointerException.class) public void testNullCalendar() throws InvalidAccessException { accessor.getTimestamp(0, null); } | @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } TimeStampMilliAccessor(TimeStampMilliVe... | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } TimeStampMilliAccessor(TimeStampMilliVe... | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } TimeStampMilliAccessor(TimeStampMilliVe... |
@Test public void ruleSuggestionsSelectNumberAtBeginning() { Selection selection = new Selection("col", "883 N Shoreline Blvd, Mountain View, CA 94043", 0, 3); List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT); assertEquals(3, rules.size()); compare(ReplaceSelectionType.CONTAINS, "883", false, rule... | @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns"); List<ReplacePatternRule> rules = new ArrayList<>(); if (selection.ge... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... |
@Test public void testGetTimestamp() throws Exception { assertEquals( new Timestamp(72, 10, 4, 3, 10, 8, (int)TimeUnit.MILLISECONDS.toNanos(957)), accessor.getTimestamp(0, PST_CALENDAR)); assertEquals( new Timestamp(72, 10, 4, 11, 10, 8, (int)TimeUnit.MILLISECONDS.toNanos(957)), accessor.getTimestamp(0, UTC_CALENDAR));... | @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } } | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } TimeStampMilliAccessor(TimeStampMilliVe... | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } TimeStampMilliAccessor(TimeStampMilliVe... | TimeStampMilliAccessor extends AbstractSqlAccessor { @Override public Timestamp getTimestamp(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve timestamp."); return getTimestamp(index, calendar.getTimeZone()); } TimeStampMilliAccessor(TimeStampMilliVe... |
@Test public void test_connect_declinesNonDremioJdbcUrl() throws SQLException { assertThat( uut.connect( "jdbc:somedb:whatever", null ), nullValue() ); } | @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPrope... | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPrope... |
@Test public void test_connect_declinesNotQuiteDremioUrl() throws SQLException { assertThat( uut.connect( "jdbc:dremio", null ), nullValue() ); } | @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPrope... | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPrope... |
@Ignore( "Just hangs, trying to connect to non-existent local zookeeper." ) @Test public void test_connect_acceptsMinimalDremioJdbcUrl() throws SQLException { assertThat( uut.connect( "jdbc:dremio:", null ), nullValue() ); fail( "Not implemented yet" ); } | @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPrope... | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPrope... |
@Ignore( "Just hangs, trying to connect to non-existent local zookeeper." ) @Test public void test_connect_DECIDEWHICHBogusDremioJdbcUrl() throws SQLException { assertThat( uut.connect( "jdbc:dremio:x=y;z;;a=b=c=d;what=ever", null ), nullValue() ); fail( "Not implemented yet" ); } | @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); } | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPrope... | Driver implements java.sql.Driver { @Override public Connection connect( String url, Properties info ) throws SQLException { return impl.connect( url, info ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPrope... |
@Test public void test_acceptsURL_acceptsDremioUrlMinimal() throws SQLException { assertThat( uut.acceptsURL("jdbc:dremio:"), equalTo( true ) ); } | @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... |
@Test public void test_acceptsURL_acceptsDremioPlusJunk() throws SQLException { assertThat( uut.acceptsURL("jdbc:dremio:should it check this?"), equalTo( true ) ); } | @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... |
@Test public void contains() throws Exception { final File dataFile = temp.newFile("containsTest.json"); try (final PrintWriter printWriter = new PrintWriter(dataFile)) { printWriter.append("{ \"col\" : \"This is an amazing restaurant. Very good food.\" }"); printWriter.append("{ \"col\" : \"This is a worst restaurant.... | public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... |
@Test public void test_acceptsURL_rejectsNonDremioJdbcUrl() throws SQLException { assertThat( uut.acceptsURL("jdbc:notdremio:whatever"), equalTo( false ) ); } | @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... |
@Test public void test_acceptsURL_rejectsNonDremioJdbc2() throws SQLException { assertThat( uut.acceptsURL("jdbc:optiq:"), equalTo( false ) ); } | @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... |
@Test public void test_acceptsURL_rejectsNonJdbcUrl() throws SQLException { assertThat( uut.acceptsURL("dremio:"), equalTo( false ) ); } | @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); } | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... | Driver implements java.sql.Driver { @Override public boolean acceptsURL( String url ) throws SQLException { return impl.acceptsURL( url ); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropert... |
@Test public void test_getByte_on_TINYINT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new TinyIntStubAccessor( (byte) 127 ) ); assertThat( uut1.getByte( 0 ), equalTo( (byte) 127 ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new TinyIntStubAccessor( (by... | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test public void test_getByte_on_SMALLINT_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new SmallIntStubAccessor( (short) 127 ) ); assertThat( uut.getByte( 0 ), equalTo( (byte) 127 ) ); } | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getByte_on_SMALLINT_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new SmallIntStubAccessor( (short) 128 ) ); try { uut.getByte( 0 ); } catch ( Throwable e ) { assertThat( e.getMes... | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test public void test_getByte_on_INTEGER_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new IntegerStubAccessor( -128 ) ); assertThat( uut.getByte( 0 ), equalTo( (byte) -128 ) ); } | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getByte_on_INTEGER_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new IntegerStubAccessor( -129 ) ); try { uut.getByte( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), c... | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test public void test_getByte_on_BIGINT_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new BigIntStubAccessor( -128 ) ); assertThat( uut.getByte( 0 ), equalTo( (byte) -128 ) ); } | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test public void startsWith() throws Exception { final File dataFile = temp.newFile("startsWithTest.json"); try (final PrintWriter printWriter = new PrintWriter(dataFile)) { printWriter.append("{ \"col\" : \"amazing restaurant. Very good food.\" }"); printWriter.append("{ \"col\" : \"This is a worst restaurant. bad fo... | public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getByte_on_BIGINT_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new BigIntStubAccessor( 129 ) ); try { uut.getByte( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), cont... | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test public void test_getByte_on_FLOAT_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new FloatStubAccessor( -128.0f ) ); assertThat( uut.getByte( 0 ), equalTo( (byte) -128 ) ); } | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getByte_on_FLOAT_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new FloatStubAccessor( -130f ) ); try { uut.getByte( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), cont... | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test public void test_getByte_on_DOUBLE_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( 127.0d ) ); assertThat( uut.getByte( 0 ), equalTo( (byte) 127) ); } | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getByte_on_DOUBLE_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( -130 ) ); try { uut.getByte( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), con... | @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort( rowOffset ), "Java short / SQL SMALLINT" ); break... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public byte getByte( int rowOffset ) throws InvalidAccessException { final byte result; switch ( getType().getMinorType() ) { case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = getByteValueOrThrow( innerAccessor.getShort... |
@Test public void test_getShort_on_TINYINT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new TinyIntStubAccessor( (byte) 127 ) ); assertThat( uut1.getShort( 0 ), equalTo( (short) 127 ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new TinyIntStubAccessor( ... | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test public void test_getShort_on_SMALLINT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new SmallIntStubAccessor( (short) 32767 ) ); assertThat( uut1.getShort( 0 ), equalTo( (short) 32767 ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new SmallIntStubAc... | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test public void test_getShort_on_INTEGER_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new IntegerStubAccessor( 32767 ) ); assertThat( uut1.getShort( 0 ), equalTo( (short) 32767 ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new IntegerStubAcce... | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getShort_on_INTEGER_thatOverflows_throws() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new IntegerStubAccessor( -32769 ) ); try { uut.getShort( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), ... | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test public void test_getShort_BIGINT_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new BigIntStubAccessor( -32678 ) ); assertThat( uut.getShort( 0 ), equalTo( (short) -32678 ) ); } | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test public void endsWith() throws Exception { final File dataFile = temp.newFile("endsWithTest.json"); try (final PrintWriter printWriter = new PrintWriter(dataFile)) { printWriter.append("{ \"col\" : \"amazing restaurant. Very good food\" }"); printWriter.append("{ \"col\" : \"This is a worst restaurant. bad food\" ... | public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getShort_on_BIGINT_thatOverflows_throws() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new BigIntStubAccessor( 65535 ) ); try { uut.getShort( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), con... | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test public void test_getShort_on_FLOAT_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new FloatStubAccessor( -32768f ) ); assertThat( uut.getShort( 0 ), equalTo( (short) -32768 ) ); } | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getShort_on_FLOAT_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new FloatStubAccessor( -32769f ) ); try { uut.getShort( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), ... | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test public void test_getShort_on_DOUBLE_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( 32767d ) ); assertThat( uut.getShort( 0 ), equalTo( (short) 32767) ); } | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getShort_on_DOUBLE_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( 32768 ) ); try { uut.getShort( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), ... | @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case INT: result = getShortValueOrThrow( innerA... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public short getShort( int rowOffset ) throws InvalidAccessException { final short result; switch ( getType().getMinorType() ) { case SMALLINT: result = innerAccessor.getShort( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); bre... |
@Test public void test_getInt_on_TINYINT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new TinyIntStubAccessor( (byte) 127 ) ); assertThat( uut1.getInt( 0 ), equalTo( 127 ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new TinyIntStubAccessor( (byte) -128 ... | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test public void test_getInt_on_SMALLINT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new SmallIntStubAccessor( (short) 32767 ) ); assertThat( uut1.getInt( 0 ), equalTo( 32767 ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new SmallIntStubAccessor( (sho... | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test public void test_getInt_on_INTEGER_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new IntegerStubAccessor( 2147483647 ) ); assertThat( uut1.getInt( 0 ), equalTo( 2147483647 ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new IntegerStubAccessor( -2147... | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test public void test_getInt_on_BIGINT_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new BigIntStubAccessor( 2147483647 ) ); assertThat( uut.getInt( 0 ), equalTo( 2147483647 ) ); } | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getInt_on_BIGINT_thatOverflows_throws() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new BigIntStubAccessor( 2147483648L ) ); try { uut.getInt( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), c... | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test public void exact() throws Exception { final File dataFile = temp.newFile("exact.json"); try (final PrintWriter printWriter = new PrintWriter(dataFile)) { printWriter.append("{ \"col\" : \"Los Angeles\" }"); printWriter.append("{ \"col\" : \"LOS ANGELES\" }"); printWriter.append("{ \"col\" : \"LOS ANGELES, CA\" }... | public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... |
@Test public void test_getInt_on_FLOAT_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new FloatStubAccessor( 1e9f ) ); assertThat( uut.getInt( 0 ), equalTo( 1_000_000_000 ) ); } | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getInt_on_FLOAT_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new FloatStubAccessor( 1e10f ) ); try { uut.getInt( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), contai... | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test public void test_getInt_on_DOUBLE_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( -2147483648.0d ) ); assertThat( uut.getInt( 0 ), equalTo( -2147483648 ) ); } | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getInt_on_DOUBLE_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( -2147483649.0d ) ); try { uut.getInt( 0 ); } catch ( Throwable e ) { assertThat( e.getMessag... | @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOffset );... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public int getInt( int rowOffset ) throws InvalidAccessException { final int result; switch ( getType().getMinorType() ) { case INT: result = innerAccessor.getInt( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMAL... |
@Test public void test_getLong_on_TINYINT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new TinyIntStubAccessor( (byte) 127 ) ); assertThat( uut1.getLong( 0 ), equalTo( 127L ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new TinyIntStubAccessor( (byte) -1... | @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... |
@Test public void test_getLong_on_SMALLINT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new SmallIntStubAccessor( (short) 32767 ) ); assertThat( uut1.getLong( 0 ), equalTo( 32767L ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new SmallIntStubAccessor( (... | @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... |
@Test public void test_getLong_on_INTEGER_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new IntegerStubAccessor( 2147483647 ) ); assertThat( uut1.getLong( 0 ), equalTo( 2147483647L ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new IntegerStubAccessor( -2... | @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... |
@Test public void test_getLong_on_BIGINT_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new BigIntStubAccessor( 2147483648L ) ); assertThat( uut.getLong( 0 ), equalTo( 2147483648L ) ); } | @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... |
@Test public void test_getLong_on_FLOAT_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new FloatStubAccessor( 9223372036854775807L * 1.0f ) ); assertThat( uut.getLong( 0 ), equalTo( 9223372036854775807L ) ); } | @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getLong_on_FLOAT_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new FloatStubAccessor( 1.5e20f ) ); try { uut.getLong( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), co... | @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... |
@Test public void matches() throws Exception { final File dataFile = temp.newFile("matches.json"); try (final PrintWriter printWriter = new PrintWriter(dataFile)) { printWriter.append("{ \"col\" : \"Los Angeles\" }"); printWriter.append("{ \"col\" : \"LOS Angeles\" }"); printWriter.append("{ \"col\" : \"LOSANGELES\" }"... | public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... |
@Test public void testIllegalUpgrade() throws Exception { thrown.expect(Exception.class); thrown.expectMessage("Illegal upgrade from OSS to EE"); final ByteString prevEdition = ByteString.copyFrom("OSS".getBytes()); final ConfigurationEntry configurationEntry = new ConfigurationEntry(); configurationEntry.setValue(prev... | @VisibleForTesting public void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdition) throws Exception { if (!getDACConfig().isMigrationEnabled()) { final ConfigurationStore configurationStore = new ConfigurationStore(storeProvider); final ConfigurationEntry entry = configurationStore.get(S... | Upgrade { @VisibleForTesting public void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdition) throws Exception { if (!getDACConfig().isMigrationEnabled()) { final ConfigurationStore configurationStore = new ConfigurationStore(storeProvider); final ConfigurationEntry entry = configurationS... | Upgrade { @VisibleForTesting public void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdition) throws Exception { if (!getDACConfig().isMigrationEnabled()) { final ConfigurationStore configurationStore = new ConfigurationStore(storeProvider); final ConfigurationEntry entry = configurationS... | Upgrade { @VisibleForTesting public void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdition) throws Exception { if (!getDACConfig().isMigrationEnabled()) { final ConfigurationStore configurationStore = new ConfigurationStore(storeProvider); final ConfigurationEntry entry = configurationS... | Upgrade { @VisibleForTesting public void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdition) throws Exception { if (!getDACConfig().isMigrationEnabled()) { final ConfigurationStore configurationStore = new ConfigurationStore(storeProvider); final ConfigurationEntry entry = configurationS... |
@Test public void test_getLong_on_DOUBLE_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( 9223372036854775807L * 1.0d ) ); assertThat( uut.getLong( 0 ), equalTo( 9223372036854775807L ) ); } | @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getLong_on_DOUBLE_thatOverflows_rejectsIt() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( 1e20 ) ); try { uut.getLong( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), con... | @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; case SMALLINT: result = innerAccessor.getShort( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public long getLong( int rowOffset ) throws InvalidAccessException { final long result; switch ( getType().getMinorType() ) { case BIGINT: result = innerAccessor.getLong( rowOffset ); break; case TINYINT: result = innerAccessor.getByte( rowOffset ); break; ca... |
@Test public void test_getFloat_on_FLOAT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new FloatStubAccessor( 1.23f ) ); assertThat( uut1.getFloat( 0 ), equalTo( 1.23f ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new FloatStubAccessor( Float.MAX_VALUE )... | @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; case BIGINT: result = innerAccessor.getLong( rowOffset... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... |
@Test public void test_getFloat_on_DOUBLE_thatFits_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new DoubleStubAccessor( 1.125 ) ); assertThat( uut1.getFloat( 0 ), equalTo( 1.125f ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new DoubleStubAccessor( Floa... | @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; case BIGINT: result = innerAccessor.getLong( rowOffset... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... |
@Test( expected = SQLConversionOverflowException.class ) public void test_getFloat_on_DOUBLE_thatOverflows_throws() throws InvalidAccessException { final SqlAccessor uut = new TypeConvertingSqlAccessor( new DoubleStubAccessor( 1e100 ) ); try { uut.getFloat( 0 ); } catch ( Throwable e ) { assertThat( e.getMessage(), con... | @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; case BIGINT: result = innerAccessor.getLong( rowOffset... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; cas... |
@Test public void test_getDouble_on_FLOAT_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new FloatStubAccessor( 6.02e23f ) ); assertThat( uut1.getDouble( 0 ), equalTo( (double) 6.02e23f ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new FloatStubAccessor( ... | @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; case BIGINT: result = innerAccessor.getLong( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break;... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break;... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break;... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break;... |
@Test public void test_getDouble_on_DOUBLE_getsIt() throws InvalidAccessException { final SqlAccessor uut1 = new TypeConvertingSqlAccessor( new DoubleStubAccessor( -1e100 ) ); assertThat( uut1.getDouble( 0 ), equalTo( -1e100 ) ); final SqlAccessor uut2 = new TypeConvertingSqlAccessor( new DoubleStubAccessor( Double.MAX... | @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break; case BIGINT: result = innerAccessor.getLong( rowOf... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break;... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break;... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break;... | TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset ); break;... |
@Test public void testEmpty() { DictionaryBuilder<String> builder = new DictionaryBuilder<>(String.class); Iterator<String> iterator = builder.build().iterator(); assertFalse(iterator.hasNext()); } | public Iterable<T> build() { Preconditions.checkArgument(!isBuilt, "build can only be called once"); isBuilt = true; if (valueAccumulator.isEmpty()) { return Collections.emptyList(); } final T[] values = ObjectArrays.newArray(clazzType, valueAccumulator.size()); for (ObjectIntCursor<T> entry : valueAccumulator) { value... | DictionaryBuilder { public Iterable<T> build() { Preconditions.checkArgument(!isBuilt, "build can only be called once"); isBuilt = true; if (valueAccumulator.isEmpty()) { return Collections.emptyList(); } final T[] values = ObjectArrays.newArray(clazzType, valueAccumulator.size()); for (ObjectIntCursor<T> entry : value... | DictionaryBuilder { public Iterable<T> build() { Preconditions.checkArgument(!isBuilt, "build can only be called once"); isBuilt = true; if (valueAccumulator.isEmpty()) { return Collections.emptyList(); } final T[] values = ObjectArrays.newArray(clazzType, valueAccumulator.size()); for (ObjectIntCursor<T> entry : value... | DictionaryBuilder { public Iterable<T> build() { Preconditions.checkArgument(!isBuilt, "build can only be called once"); isBuilt = true; if (valueAccumulator.isEmpty()) { return Collections.emptyList(); } final T[] values = ObjectArrays.newArray(clazzType, valueAccumulator.size()); for (ObjectIntCursor<T> entry : value... | DictionaryBuilder { public Iterable<T> build() { Preconditions.checkArgument(!isBuilt, "build can only be called once"); isBuilt = true; if (valueAccumulator.isEmpty()) { return Collections.emptyList(); } final T[] values = ObjectArrays.newArray(clazzType, valueAccumulator.size()); for (ObjectIntCursor<T> entry : value... |
@Test public void buildInputFormatLookup() { { assertTrue(HiveReaderProtoUtil.buildInputFormatLookup(HiveTableXattr.newBuilder().build()).size() == 0); } { HiveTableXattr xattr = HiveTableXattr.newBuilder() .addAllPartitionXattrs( Lists.newArrayList( newPartitionXattrWithInputFormat("a"), newPartitionXattrWithInputForm... | @Deprecated static Map<String, Integer> buildInputFormatLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<String, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { if (partitionXattr.hasInputFormat() && !lookup.containsKey(partitionXat... | HiveReaderProtoUtil { @Deprecated static Map<String, Integer> buildInputFormatLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<String, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { if (partitionXattr.hasInputFormat() && !lookup.co... | HiveReaderProtoUtil { @Deprecated static Map<String, Integer> buildInputFormatLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<String, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { if (partitionXattr.hasInputFormat() && !lookup.co... | HiveReaderProtoUtil { @Deprecated static Map<String, Integer> buildInputFormatLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<String, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { if (partitionXattr.hasInputFormat() && !lookup.co... | HiveReaderProtoUtil { @Deprecated static Map<String, Integer> buildInputFormatLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<String, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { if (partitionXattr.hasInputFormat() && !lookup.co... |
@Test public void buildPropLookup() { { assertTrue(HiveReaderProtoUtil.buildPropLookup(HiveTableXattr.newBuilder().build()).size() == 0); } { HiveTableXattr.Builder xattr = HiveTableXattr.newBuilder() .addAllPartitionXattrs( Lists.newArrayList( newPartitionXattrWithProps(newProp("a", "b")), newPartitionXattrWithProps(n... | @Deprecated static Map<Prop, Integer> buildPropLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<Prop, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { for (final Prop prop : partitionXattr.getPartitionPropertyList()) { if (!lookup.co... | HiveReaderProtoUtil { @Deprecated static Map<Prop, Integer> buildPropLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<Prop, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { for (final Prop prop : partitionXattr.getPartitionPropertyLi... | HiveReaderProtoUtil { @Deprecated static Map<Prop, Integer> buildPropLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<Prop, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { for (final Prop prop : partitionXattr.getPartitionPropertyLi... | HiveReaderProtoUtil { @Deprecated static Map<Prop, Integer> buildPropLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<Prop, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { for (final Prop prop : partitionXattr.getPartitionPropertyLi... | HiveReaderProtoUtil { @Deprecated static Map<Prop, Integer> buildPropLookup(HiveTableXattrOrBuilder tableXattr) { int i = 0; final Map<Prop, Integer> lookup = Maps.newHashMap(); for (final PartitionXattr partitionXattr : tableXattr.getPartitionXattrsList()) { for (final Prop prop : partitionXattr.getPartitionPropertyLi... |
@Test public void isNull() throws Exception { final File dataFile = temp.newFile("nullTest.json"); try (final PrintWriter printWriter = new PrintWriter(dataFile)) { printWriter.append("{ \"col\" : \"Los Angeles\" }"); printWriter.append("{ \"col\" : null }"); } ReplacePatternRule rule = new ReplacePatternRule() .setSel... | public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } } | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public TransformRuleWrapper<ReplacePatternRule> wrapRule(ReplacePatternRule rule) { return new ReplaceTransformRuleWrapper(rule); } @Override List<ReplacePatternRule> getRules(Selection selection, DataType selColType); TransformRuleWrapper<Replace... |
@Test public void testAzureOauthCopy() { DremioFileSystem fileSystem = new DremioFileSystem(); Configuration conf = new Configuration(); conf.set(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ENDPOINT, ENDPOINT); conf.set(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID, CLIEN_ID); conf.set(FS_AZURE_ACCOUNT_OAUTH_CLIENT_SECRET, PASSWORD); fileSystem.... | void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshToken = getValueForProperty(conf, FS_AZU... | DremioFileSystem extends FileSystem { void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshTo... | DremioFileSystem extends FileSystem { void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshTo... | DremioFileSystem extends FileSystem { void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshTo... | DremioFileSystem extends FileSystem { void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshTo... |
@Test public void testAzureOauthCopyWithAccountProperties() { DremioFileSystem fileSystem = new DremioFileSystem(); Configuration conf = new Configuration(); conf.set(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ENDPOINT + ".testAccount", ENDPOINT); conf.set(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID + ".testAccount", CLIEN_ID); conf.set(FS_AZ... | void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshToken = getValueForProperty(conf, FS_AZU... | DremioFileSystem extends FileSystem { void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshTo... | DremioFileSystem extends FileSystem { void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshTo... | DremioFileSystem extends FileSystem { void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshTo... | DremioFileSystem extends FileSystem { void updateOAuthConfig(Configuration conf, String accountName, String accountNameWithoutSuffix) { final String CLIENT_ID = "dremio.azure.clientId"; final String TOKEN_ENDPOINT = "dremio.azure.tokenEndpoint"; final String CLIENT_SECRET = "dremio.azure.clientSecret"; String refreshTo... |
@Test public void ensureStoragePluginIsUsedForUsername() throws Exception { final String originalName = "Test"; final String finalName = "Replaced"; final HiveScanBatchCreator creator = new HiveScanBatchCreator(); final HiveStoragePlugin plugin = mock(HiveStoragePlugin.class); when(plugin.getUsername(originalName)).the... | @VisibleForTesting public UserGroupInformation getUGI(HiveStoragePlugin storagePlugin, HiveProxyingSubScan config) { final String userName = storagePlugin.getUsername(config.getProps().getUserName()); return HiveImpersonationUtil.createProxyUgi(userName); } | HiveScanBatchCreator implements HiveProxiedScanBatchCreator { @VisibleForTesting public UserGroupInformation getUGI(HiveStoragePlugin storagePlugin, HiveProxyingSubScan config) { final String userName = storagePlugin.getUsername(config.getProps().getUserName()); return HiveImpersonationUtil.createProxyUgi(userName); } ... | HiveScanBatchCreator implements HiveProxiedScanBatchCreator { @VisibleForTesting public UserGroupInformation getUGI(HiveStoragePlugin storagePlugin, HiveProxyingSubScan config) { final String userName = storagePlugin.getUsername(config.getProps().getUserName()); return HiveImpersonationUtil.createProxyUgi(userName); } ... | HiveScanBatchCreator implements HiveProxiedScanBatchCreator { @VisibleForTesting public UserGroupInformation getUGI(HiveStoragePlugin storagePlugin, HiveProxyingSubScan config) { final String userName = storagePlugin.getUsername(config.getProps().getUserName()); return HiveImpersonationUtil.createProxyUgi(userName); } ... | HiveScanBatchCreator implements HiveProxiedScanBatchCreator { @VisibleForTesting public UserGroupInformation getUGI(HiveStoragePlugin storagePlugin, HiveProxyingSubScan config) { final String userName = storagePlugin.getUsername(config.getProps().getUserName()); return HiveImpersonationUtil.createProxyUgi(userName); } ... |
@Test public void testAllSplitsAreOnS3() { List<SplitAndPartitionInfo> s3Splits = buildSplits("s3"); List<SplitAndPartitionInfo> hdfsplits = buildSplits("hdfs"); HiveScanBatchCreator scanBatchCreator = new HiveScanBatchCreator(); assertTrue(scanBatchCreator.allSplitsAreOnS3(s3Splits)); assertFalse(scanBatchCreator.allS... | boolean allSplitsAreOnS3(List<SplitAndPartitionInfo> splits) { for (SplitAndPartitionInfo split : splits) { try { final HiveReaderProto.HiveSplitXattr splitAttr = HiveReaderProto.HiveSplitXattr.parseFrom(split.getDatasetSplitInfo().getExtendedProperty()); final FileSplit fullFileSplit = (FileSplit) HiveUtilities.deseri... | HiveScanBatchCreator implements HiveProxiedScanBatchCreator { boolean allSplitsAreOnS3(List<SplitAndPartitionInfo> splits) { for (SplitAndPartitionInfo split : splits) { try { final HiveReaderProto.HiveSplitXattr splitAttr = HiveReaderProto.HiveSplitXattr.parseFrom(split.getDatasetSplitInfo().getExtendedProperty()); fi... | HiveScanBatchCreator implements HiveProxiedScanBatchCreator { boolean allSplitsAreOnS3(List<SplitAndPartitionInfo> splits) { for (SplitAndPartitionInfo split : splits) { try { final HiveReaderProto.HiveSplitXattr splitAttr = HiveReaderProto.HiveSplitXattr.parseFrom(split.getDatasetSplitInfo().getExtendedProperty()); fi... | HiveScanBatchCreator implements HiveProxiedScanBatchCreator { boolean allSplitsAreOnS3(List<SplitAndPartitionInfo> splits) { for (SplitAndPartitionInfo split : splits) { try { final HiveReaderProto.HiveSplitXattr splitAttr = HiveReaderProto.HiveSplitXattr.parseFrom(split.getDatasetSplitInfo().getExtendedProperty()); fi... | HiveScanBatchCreator implements HiveProxiedScanBatchCreator { boolean allSplitsAreOnS3(List<SplitAndPartitionInfo> splits) { for (SplitAndPartitionInfo split : splits) { try { final HiveReaderProto.HiveSplitXattr splitAttr = HiveReaderProto.HiveSplitXattr.parseFrom(split.getDatasetSplitInfo().getExtendedProperty()); fi... |
@Test public void impersonationDisabledShouldReturnSystemUser() { final HiveConf hiveConf = new HiveConf(); hiveConf.setBoolVar(HIVE_SERVER2_ENABLE_DOAS, false); final SabotContext context = mock(SabotContext.class); final HiveStoragePlugin plugin = createHiveStoragePlugin(hiveConf, context); final String userName = pl... | public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return SystemUser.SYSTEM_USERNAME; } | HiveStoragePlugin extends BaseHiveStoragePlugin implements StoragePluginCreator.PF4JStoragePlugin, SupportsReadSignature,
SupportsListingDatasets, SupportsAlteringDatasetMetadata, SupportsPF4JStoragePlugin { public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return System... | HiveStoragePlugin extends BaseHiveStoragePlugin implements StoragePluginCreator.PF4JStoragePlugin, SupportsReadSignature,
SupportsListingDatasets, SupportsAlteringDatasetMetadata, SupportsPF4JStoragePlugin { public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return System... | HiveStoragePlugin extends BaseHiveStoragePlugin implements StoragePluginCreator.PF4JStoragePlugin, SupportsReadSignature,
SupportsListingDatasets, SupportsAlteringDatasetMetadata, SupportsPF4JStoragePlugin { public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return System... | HiveStoragePlugin extends BaseHiveStoragePlugin implements StoragePluginCreator.PF4JStoragePlugin, SupportsReadSignature,
SupportsListingDatasets, SupportsAlteringDatasetMetadata, SupportsPF4JStoragePlugin { public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return System... |
@Test public void impersonationEnabledShouldReturnUser() { final HiveConf hiveConf = new HiveConf(); hiveConf.setBoolVar(HIVE_SERVER2_ENABLE_DOAS, true); final SabotContext context = mock(SabotContext.class); final HiveStoragePlugin plugin = new HiveStoragePlugin(hiveConf, context, "foo"); final String userName = plugi... | public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return SystemUser.SYSTEM_USERNAME; } | HiveStoragePlugin extends BaseHiveStoragePlugin implements StoragePluginCreator.PF4JStoragePlugin, SupportsReadSignature,
SupportsListingDatasets, SupportsAlteringDatasetMetadata, SupportsPF4JStoragePlugin { public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return System... | HiveStoragePlugin extends BaseHiveStoragePlugin implements StoragePluginCreator.PF4JStoragePlugin, SupportsReadSignature,
SupportsListingDatasets, SupportsAlteringDatasetMetadata, SupportsPF4JStoragePlugin { public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return System... | HiveStoragePlugin extends BaseHiveStoragePlugin implements StoragePluginCreator.PF4JStoragePlugin, SupportsReadSignature,
SupportsListingDatasets, SupportsAlteringDatasetMetadata, SupportsPF4JStoragePlugin { public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return System... | HiveStoragePlugin extends BaseHiveStoragePlugin implements StoragePluginCreator.PF4JStoragePlugin, SupportsReadSignature,
SupportsListingDatasets, SupportsAlteringDatasetMetadata, SupportsPF4JStoragePlugin { public String getUsername(String name) { if (isStorageImpersonationEnabled()) { return name; } return System... |
@Test public void testValidRegionFromEndpoint() { Region r = S3FileSystem.getAwsRegionFromEndpoint("s3-eu-central-1.amazonaws.com"); Assert.assertEquals(Region.EU_CENTRAL_1, r); r = S3FileSystem.getAwsRegionFromEndpoint("s3-us-gov-west-1.amazonaws.com"); Assert.assertEquals(Region.US_GOV_WEST_1, r); r = S3FileSystem.ge... | static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .flatMap(e -> software.amazon.awssdk.regions.Region.regions() .stream() .filter(... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .fla... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .fla... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .fla... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .fla... |
@Test public void testInvalidRegionFromEndpoint() { Region r = S3FileSystem.getAwsRegionFromEndpoint("us-west-1"); Assert.assertEquals(Region.US_EAST_1, r); r = S3FileSystem.getAwsRegionFromEndpoint("s3-eu-central-1"); Assert.assertEquals(Region.US_EAST_1, r); r = S3FileSystem.getAwsRegionFromEndpoint("abc"); Assert.as... | static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .flatMap(e -> software.amazon.awssdk.regions.Region.regions() .stream() .filter(... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .fla... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .fla... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .fla... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) { return Optional.ofNullable(endpoint) .map(e -> e.toLowerCase(Locale.ROOT)) .filter(e -> e.endsWith(S3_ENDPOINT_END) || e.endsWith(S3_CN_ENDPOINT_END)) .fla... |
@Test public void testUnknownContainerExists() { TestExtendedS3FileSystem fs = new TestExtendedS3FileSystem(); AmazonS3 mockedS3Client = mock(AmazonS3.class); when(mockedS3Client.doesBucketExistV2(any(String.class))).thenReturn(true); ListObjectsV2Result result = new ListObjectsV2Result(); result.setBucketName("testunk... | @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .withMaxKeys(1) .withRequesterPays(isRequesterPays()) .withEncodingType("url") .... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... |
@Test (expected = ContainerNotFoundException.class) public void testUnknownContainerNotExists() throws IOException { TestExtendedS3FileSystem fs = new TestExtendedS3FileSystem(); AmazonS3 mockedS3Client = mock(AmazonS3.class); when(mockedS3Client.doesBucketExistV2(any(String.class))).thenReturn(false); fs.setCustomClie... | @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .withMaxKeys(1) .withRequesterPays(isRequesterPays()) .withEncodingType("url") .... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... |
@Test public void ruleSuggestionsAlphabetCharsDelimiter() { Selection selection = new Selection("col", "abbbabbabbaaa", 1, 2); List<SplitRule> rules = recommender.getRules(selection, TEXT); assertEquals(2, rules.size()); compare(MatchType.exact, "bb", false, rules.get(0)); compare(MatchType.exact, "bb", true, rules.get... | @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText().substring(selection.getOffset(), selection.getOffset() + s... | SplitRecommender extends Recommender<SplitRule, Selection> { @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText... | SplitRecommender extends Recommender<SplitRule, Selection> { @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText... | SplitRecommender extends Recommender<SplitRule, Selection> { @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText... | SplitRecommender extends Recommender<SplitRule, Selection> { @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText... |
@Test (expected = ContainerAccessDeniedException.class) public void testUnknownContainerExistsButNoPermissions() throws IOException { TestExtendedS3FileSystem fs = new TestExtendedS3FileSystem(); AmazonS3 mockedS3Client = mock(AmazonS3.class); when(mockedS3Client.doesBucketExistV2(any(String.class))).thenReturn(true); ... | @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .withMaxKeys(1) .withRequesterPays(isRequesterPays()) .withEncodingType("url") .... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { @Override protected ContainerHolder getUnknownContainer(String containerName) throws IOException { boolean containerFound = false; try { if (s3.doesBucketExistV2(containerName)) { final ListObjectsV2Request req = new ListObjectsV2Request() .wit... |
@Test public void testVerifyCredentialsRetry() { PowerMockito.mockStatic(StsClient.class); StsClient mockedClient = mock(StsClient.class); StsClientBuilder mockedClientBuilder = mock(StsClientBuilder.class); when(mockedClientBuilder.credentialsProvider(any(AwsCredentialsProvider.class))).thenReturn(mockedClientBuilder)... | protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCredentialsProvider) .region(getAWSRegionFromConfigurationOrDefault(conf)); try (S... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCreden... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCreden... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCreden... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCreden... |
@Test(expected = RuntimeException.class) public void testVerifyCredentialsNoRetryOnAuthnError() { PowerMockito.mockStatic(StsClient.class); StsClient mockedClient = mock(StsClient.class); StsClientBuilder mockedClientBuilder = mock(StsClientBuilder.class); when(mockedClientBuilder.credentialsProvider(any(AwsCredentials... | protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCredentialsProvider) .region(getAWSRegionFromConfigurationOrDefault(conf)); try (S... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCreden... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCreden... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCreden... | S3FileSystem extends ContainerFileSystem implements MayProvideAsyncStream { protected void verifyCredentials(Configuration conf) throws RuntimeException { AwsCredentialsProvider awsCredentialsProvider = getAsync2Provider(conf); final StsClientBuilder stsClientBuilder = StsClient.builder() .credentialsProvider(awsCreden... |
@Test public void transformContainerPathWithColon() { final Path path = new Path("s3a: final String containerName = "qa1.dremio.com"; final Path transformed = ContainerFileSystem.transform(path, containerName); Assert.assertEquals(new Path("/qa1.dremio.com/test:breaks"), transformed); } | @VisibleForTesting static Path transform(Path path, String containerName) { final String relativePath = removeLeadingSlash(Path.getPathWithoutSchemeAndAuthority(path).toString()); final Path containerPath = new Path(Path.SEPARATOR + containerName); return Strings.isNullOrEmpty(relativePath) ? containerPath : new Path(c... | ContainerFileSystem extends FileSystem { @VisibleForTesting static Path transform(Path path, String containerName) { final String relativePath = removeLeadingSlash(Path.getPathWithoutSchemeAndAuthority(path).toString()); final Path containerPath = new Path(Path.SEPARATOR + containerName); return Strings.isNullOrEmpty(r... | ContainerFileSystem extends FileSystem { @VisibleForTesting static Path transform(Path path, String containerName) { final String relativePath = removeLeadingSlash(Path.getPathWithoutSchemeAndAuthority(path).toString()); final Path containerPath = new Path(Path.SEPARATOR + containerName); return Strings.isNullOrEmpty(r... | ContainerFileSystem extends FileSystem { @VisibleForTesting static Path transform(Path path, String containerName) { final String relativePath = removeLeadingSlash(Path.getPathWithoutSchemeAndAuthority(path).toString()); final Path containerPath = new Path(Path.SEPARATOR + containerName); return Strings.isNullOrEmpty(r... | ContainerFileSystem extends FileSystem { @VisibleForTesting static Path transform(Path path, String containerName) { final String relativePath = removeLeadingSlash(Path.getPathWithoutSchemeAndAuthority(path).toString()); final Path containerPath = new Path(Path.SEPARATOR + containerName); return Strings.isNullOrEmpty(r... |
@Test public void testAsyncHttpClientClosedError() { AsyncHttpClient client = mock(AsyncHttpClient.class); when(client.isClosed()).thenReturn(true); LocalDateTime versionDate = LocalDateTime.now(ZoneId.of("GMT")).minusDays(2); AzureAsyncReader azureAsyncReader = spy(new AzureAsyncReader( "account", new Path("container/... | @Override public CompletableFuture<Void> readFully(long offset, ByteBuf dst, int dstOffset, int len) { return read(offset, dst, dstOffset, len, 0); } | AzureAsyncReader extends ExponentialBackoff implements AutoCloseable, AsyncByteReader { @Override public CompletableFuture<Void> readFully(long offset, ByteBuf dst, int dstOffset, int len) { return read(offset, dst, dstOffset, len, 0); } } | AzureAsyncReader extends ExponentialBackoff implements AutoCloseable, AsyncByteReader { @Override public CompletableFuture<Void> readFully(long offset, ByteBuf dst, int dstOffset, int len) { return read(offset, dst, dstOffset, len, 0); } AzureAsyncReader(final String accountName,
final Path pa... | AzureAsyncReader extends ExponentialBackoff implements AutoCloseable, AsyncByteReader { @Override public CompletableFuture<Void> readFully(long offset, ByteBuf dst, int dstOffset, int len) { return read(offset, dst, dstOffset, len, 0); } AzureAsyncReader(final String accountName,
final Path pa... | AzureAsyncReader extends ExponentialBackoff implements AutoCloseable, AsyncByteReader { @Override public CompletableFuture<Void> readFully(long offset, ByteBuf dst, int dstOffset, int len) { return read(offset, dst, dstOffset, len, 0); } AzureAsyncReader(final String accountName,
final Path pa... |
@Test public void testListContainers() throws IOException, ExecutionException, InterruptedException { AsyncHttpClient client = mock(AsyncHttpClient.class); Response response = mock(Response.class); when(response.getHeader(any(String.class))).thenReturn(""); HttpResponseStatus status = mock(HttpResponseStatus.class); wh... | @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliteratorUnknownSize(containerIterator, Spliterator.ORDERED), false)... | AzureAsyncContainerProvider implements ContainerProvider { @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliterator... | AzureAsyncContainerProvider implements ContainerProvider { @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliterator... | AzureAsyncContainerProvider implements ContainerProvider { @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliterator... | AzureAsyncContainerProvider implements ContainerProvider { @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliterator... |
@Test public void testListContainersWithRetry() throws IOException, ExecutionException, InterruptedException { AsyncHttpClient client = mock(AsyncHttpClient.class); Response response = mock(Response.class); when(response.getHeader(any(String.class))).thenReturn(""); HttpResponseStatus status = mock(HttpResponseStatus.c... | @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliteratorUnknownSize(containerIterator, Spliterator.ORDERED), false)... | AzureAsyncContainerProvider implements ContainerProvider { @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliterator... | AzureAsyncContainerProvider implements ContainerProvider { @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliterator... | AzureAsyncContainerProvider implements ContainerProvider { @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliterator... | AzureAsyncContainerProvider implements ContainerProvider { @Override public Stream<ContainerFileSystem.ContainerCreator> getContainerCreators() { Iterator<String> containerIterator = new DFSContainerIterator(asyncHttpClient, account, authProvider, isSecure, retryer); return StreamSupport.stream(Spliterators.spliterator... |
@Test public void testDoesContainerExists() throws ExecutionException, InterruptedException { AzureStorageFileSystem parentClass = mock(AzureStorageFileSystem.class); AzureAuthTokenProvider authTokenProvider = getMockAuthTokenProvider(); AsyncHttpClient client = mock(AsyncHttpClient.class); Response response = mock(Res... | @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDateFormat(System.currentTimeMillis())) .addHeader("x-ms-versi... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... |
@Test public void testDoesContainerExistsNotFound() throws ExecutionException, InterruptedException { AzureStorageFileSystem parentClass = mock(AzureStorageFileSystem.class); AzureAuthTokenProvider authTokenProvider = getMockAuthTokenProvider(); AsyncHttpClient client = mock(AsyncHttpClient.class); Response response = ... | @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDateFormat(System.currentTimeMillis())) .addHeader("x-ms-versi... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... |
@Test public void testDoesContainerExistsAccessDenied() throws ExecutionException, InterruptedException { AzureStorageFileSystem parentClass = mock(AzureStorageFileSystem.class); AzureAuthTokenProvider authTokenProvider = getMockAuthTokenProvider(); AsyncHttpClient client = mock(AsyncHttpClient.class); Response respons... | @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDateFormat(System.currentTimeMillis())) .addHeader("x-ms-versi... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... | AzureAsyncContainerProvider implements ContainerProvider { @Override public void assertContainerExists(final String containerName) { logger.debug("Checking for missing azure container " + account + ":" + containerName); final Request req = new RequestBuilder(HttpConstants.Methods.HEAD) .addHeader("x-ms-date", toHttpDat... |
@Test public void ruleSuggestionsPipeDelimiter() { Selection selection = new Selection("col", "1|2|3|4|5", 1, 1); List<SplitRule> rules = recommender.getRules(selection, TEXT); assertEquals(1, rules.size()); compare(MatchType.exact, "|", false, rules.get(0)); } | @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText().substring(selection.getOffset(), selection.getOffset() + s... | SplitRecommender extends Recommender<SplitRule, Selection> { @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText... | SplitRecommender extends Recommender<SplitRule, Selection> { @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText... | SplitRecommender extends Recommender<SplitRule, Selection> { @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText... | SplitRecommender extends Recommender<SplitRule, Selection> { @Override public List<SplitRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.TEXT, "Split is supported only on TEXT type columns"); List<SplitRule> rules = new ArrayList<>(); String seltext = selection.getCellText... |
@Test public void testSameInstance() throws InterruptedException { ExecutorService ex = Executors.newFixedThreadPool(10); final Set<Integer> objectIdentities = new ConcurrentSkipListSet<>(); CountDownLatch latch = new CountDownLatch(100); for (int i=0; i<100; i++) { ex.execute(() -> { objectIdentities.add(System.identi... | public static AsyncHttpClient getInstance(){ return SingletonHelper.INSTANCE; } | AsyncHttpClientProvider { public static AsyncHttpClient getInstance(){ return SingletonHelper.INSTANCE; } } | AsyncHttpClientProvider { public static AsyncHttpClient getInstance(){ return SingletonHelper.INSTANCE; } } | AsyncHttpClientProvider { public static AsyncHttpClient getInstance(){ return SingletonHelper.INSTANCE; } static AsyncHttpClient getInstance(); } | AsyncHttpClientProvider { public static AsyncHttpClient getInstance(){ return SingletonHelper.INSTANCE; } static AsyncHttpClient getInstance(); static final int DEFAULT_REQUEST_TIMEOUT; } |
@Test public void testGetAuthzHeaderValue() { String authzHeaderValue = authTokenProvider.getAuthzHeaderValue(prepareTestRequest()); assertEquals("SharedKey mock-account:ZwovG4J+nCDc3w58WPei6fvJBQsO96YojteJncy0wwI=", authzHeaderValue); } | @Override public String getAuthzHeaderValue(final Request req) { try { final URL url = new URL(req.getUrl()); final Map<String, String> headersMap = new HashMap<>(); req.getHeaders().forEach(header -> headersMap.put(header.getKey(), header.getValue())); return this.storageSharedKeyCredential.generateAuthorizationHeader... | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public String getAuthzHeaderValue(final Request req) { try { final URL url = new URL(req.getUrl()); final Map<String, String> headersMap = new HashMap<>(); req.getHeaders().forEach(header -> headersMap.put(header.getKey(), header.getValue()))... | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public String getAuthzHeaderValue(final Request req) { try { final URL url = new URL(req.getUrl()); final Map<String, String> headersMap = new HashMap<>(); req.getHeaders().forEach(header -> headersMap.put(header.getKey(), header.getValue()))... | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public String getAuthzHeaderValue(final Request req) { try { final URL url = new URL(req.getUrl()); final Map<String, String> headersMap = new HashMap<>(); req.getHeaders().forEach(header -> headersMap.put(header.getKey(), header.getValue()))... | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public String getAuthzHeaderValue(final Request req) { try { final URL url = new URL(req.getUrl()); final Map<String, String> headersMap = new HashMap<>(); req.getHeaders().forEach(header -> headersMap.put(header.getKey(), header.getValue()))... |
@Test public void testCheckAndUpdate() { assertFalse("Shared key token is static. There shouldn't ever be an update required", authTokenProvider.checkAndUpdateToken()); } | @Override public boolean checkAndUpdateToken() { return false; } | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public boolean checkAndUpdateToken() { return false; } } | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public boolean checkAndUpdateToken() { return false; } AzureSharedKeyAuthTokenProvider(final String accountName, final String key); } | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public boolean checkAndUpdateToken() { return false; } AzureSharedKeyAuthTokenProvider(final String accountName, final String key); @Override boolean checkAndUpdateToken(); @Override String getAuthzHeaderValue(final Request req); @Override bo... | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public boolean checkAndUpdateToken() { return false; } AzureSharedKeyAuthTokenProvider(final String accountName, final String key); @Override boolean checkAndUpdateToken(); @Override String getAuthzHeaderValue(final Request req); @Override bo... |
@Test public void testIsCloseToExpiry() { assertFalse("Shared key token never expires", authTokenProvider.isCloseToExpiry()); } | @Override public boolean isCloseToExpiry() { return false; } | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public boolean isCloseToExpiry() { return false; } } | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public boolean isCloseToExpiry() { return false; } AzureSharedKeyAuthTokenProvider(final String accountName, final String key); } | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public boolean isCloseToExpiry() { return false; } AzureSharedKeyAuthTokenProvider(final String accountName, final String key); @Override boolean checkAndUpdateToken(); @Override String getAuthzHeaderValue(final Request req); @Override boolea... | AzureSharedKeyAuthTokenProvider implements AzureAuthTokenProvider { @Override public boolean isCloseToExpiry() { return false; } AzureSharedKeyAuthTokenProvider(final String accountName, final String key); @Override boolean checkAndUpdateToken(); @Override String getAuthzHeaderValue(final Request req); @Override boolea... |
@Test public void testToProtobuFileStatus() throws IOException { FileStatus status = TEST_FILE_STATUS; DFS.FileStatus result = RemoteNodeFileSystem.toProtoFileStatus(status); assertEquals(TEST_PATH_STRING, result.getPath()); assertEquals(1024,result.getLength()); assertFalse(result.getIsDirectory()); assertEquals(1, re... | static DFS.FileStatus toProtoFileStatus(FileStatus status) throws IOException { DFS.FileStatus.Builder builder = DFS.FileStatus.newBuilder(); builder .setLength(status.getLen()) .setIsDirectory(status.isDirectory()) .setBlockReplication(status.getReplication()) .setBlockSize(status.getBlockSize()) .setModificationTime(... | RemoteNodeFileSystem extends FileSystem { static DFS.FileStatus toProtoFileStatus(FileStatus status) throws IOException { DFS.FileStatus.Builder builder = DFS.FileStatus.newBuilder(); builder .setLength(status.getLen()) .setIsDirectory(status.isDirectory()) .setBlockReplication(status.getReplication()) .setBlockSize(st... | RemoteNodeFileSystem extends FileSystem { static DFS.FileStatus toProtoFileStatus(FileStatus status) throws IOException { DFS.FileStatus.Builder builder = DFS.FileStatus.newBuilder(); builder .setLength(status.getLen()) .setIsDirectory(status.isDirectory()) .setBlockReplication(status.getReplication()) .setBlockSize(st... | RemoteNodeFileSystem extends FileSystem { static DFS.FileStatus toProtoFileStatus(FileStatus status) throws IOException { DFS.FileStatus.Builder builder = DFS.FileStatus.newBuilder(); builder .setLength(status.getLen()) .setIsDirectory(status.isDirectory()) .setBlockReplication(status.getReplication()) .setBlockSize(st... | RemoteNodeFileSystem extends FileSystem { static DFS.FileStatus toProtoFileStatus(FileStatus status) throws IOException { DFS.FileStatus.Builder builder = DFS.FileStatus.newBuilder(); builder .setLength(status.getLen()) .setIsDirectory(status.isDirectory()) .setBlockReplication(status.getReplication()) .setBlockSize(st... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.