echauchot commented on code in PR #3:
URL:
https://github.com/apache/flink-connector-cassandra/pull/3#discussion_r1137073849
##########
flink-connector-cassandra/src/main/java/org/apache/flink/connector/cassandra/source/CassandraSource.java:
##########
@@ -80,27 +85,55 @@
public class CassandraSource<OUT>
implements Source<OUT, CassandraSplit, CassandraEnumeratorState>,
ResultTypeQueryable<OUT> {
- public static final String CQL_PROHIBITTED_CLAUSES_REGEXP =
+ public static final String CQL_PROHIBITED_CLAUSES_REGEXP =
"(?i).*(AVG|COUNT|MIN|MAX|SUM|ORDER|GROUP BY).*";
+ public static final String SELECT_REGEXP = "(?i)select .+ from
(\\w+)\\.(\\w+).*;$";
+
private static final long serialVersionUID = 1L;
private final ClusterBuilder clusterBuilder;
+ @Nullable private final Long maxSplitMemorySize;
private final Class<OUT> pojoClass;
private final String query;
+ private final String keyspace;
+ private final String table;
private final MapperOptions mapperOptions;
public CassandraSource(
ClusterBuilder clusterBuilder,
Class<OUT> pojoClass,
String query,
MapperOptions mapperOptions) {
+ this(clusterBuilder, null, pojoClass, query, mapperOptions);
+ }
+
+ public CassandraSource(
+ ClusterBuilder clusterBuilder,
+ Long maxSplitMemorySize,
+ Class<OUT> pojoClass,
+ String query,
+ MapperOptions mapperOptions) {
checkNotNull(clusterBuilder, "ClusterBuilder required but not
provided");
+ checkState(
+ maxSplitMemorySize == null || maxSplitMemorySize > 0,
+ "Max split size in bytes provided but set to an invalid value
{}",
+ maxSplitMemorySize);
checkNotNull(pojoClass, "POJO class required but not provided");
- checkQueryValidity(query);
Review Comment:
If you prefer that, fair enough
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]