You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by StephanEwen <gi...@git.apache.org> on 2017/05/02 10:08:58 UTC

[GitHub] flink pull request #2633: [FLINK-4497] CassadraSink support for scala tuples...

Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2633#discussion_r114286727
  
    --- Diff: flink-streaming-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraConnectorITCase.java ---
    @@ -389,4 +403,54 @@ private TestCassandraTupleWriteAheadSink(String tableName, TypeSerializer<IN> se
     			this.tableName = tableName;
     		}
     	}
    +
    +	@Test
    +	public void testCassandraScalaTupleAtLeastOnceSinkBuilderDetection() throws Exception {
    +		Class<Tuple1<String>> c = (Class<Tuple1<String>>) new Tuple1<>("hello").getClass();
    +		Seq<TypeInformation<?>> typeInfos = JavaConverters.asScalaBufferConverter(
    +			Arrays.<TypeInformation<?>>asList(new TypeInformation[]{BasicTypeInfo.STRING_TYPE_INFO})).asScala();
    +		Seq<String> fieldNames = JavaConverters.asScalaBufferConverter(
    +			Arrays.asList(new String[]{"_1"})).asScala();
    +
    +		CaseClassTypeInfo<Tuple1<String>> typeInfo = new CaseClassTypeInfo<Tuple1<String>>(c, null, typeInfos, fieldNames) {
    +			@Override
    +			public TypeSerializer<Tuple1<String>> createSerializer(ExecutionConfig config) {
    +				return null;
    +			}
    +		};
    +
    +		StreamExecutionEnvironment env = mock(StreamExecutionEnvironment.class);
    --- End diff --
    
    I think there is no need to mock this. You can use a regular execution environment.
    Unless you call `execute()`, no mini cluster would be spawned anyways.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---