Source:
@Override public KafkaStreamTable create(SchemaPlus schema, String name, Map<String, Object> operand, RelDataType rowType) { KafkaTableOptions tableOptionBuilder = new KafkaTableOptions(); tableOptionBuilder.setBootstrapServers( (String) operand.getOrDefault(KafkaTableConstants.SCHEMA_BOOTSTRAP_SERVERS, null)); tableOptionBuilder.setTopicName( (String) operand.getOrDefault(KafkaTableConstants.SCHEMA_TOPIC_NAME, null)); KafkaRowConverter rowConverter = null; if (operand.containsKey(KafkaTableConstants.SCHEMA_ROW_CONVERTER)) { String rowConverterClass = (String) operand.get(KafkaTableConstants.SCHEMA_ROW_CONVERTER); try { rowConverter = (KafkaRowConverter) Class.forName(rowConverterClass).newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { final String details = String.format( Locale.getDefault(), "Fail to create table '%s' with configuration: \n" + "'%s'\n" + "KafkaRowConverter '%s' is invalid", name, operand, rowConverterClass); throw new RuntimeException(details, e); } } else { rowConverter = new KafkaRowConverterImpl(); } tableOptionBuilder.setRowConverter(rowConverter); if (operand.containsKey(KafkaTableConstants.SCHEMA_CONSUMER_PARA)) { tableOptionBuilder.setConsumerParams((Map) operand.get( KafkaTableConstants.SCHEMA_CONSUMER_PARA)); } if (operand.containsKey(KafkaTableConstants.SCHEMA_CUST_CONSUMER)) { String custConsumerClass = (String) operand.get(KafkaTableConstants.SCHEMA_CUST_CONSUMER); try { tableOptionBuilder.setConsumer( (Consumer) Class.forName(custConsumerClass) .getConstructor(OffsetResetStrategy.class) .newInstance(OffsetResetStrategy.NONE) ); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { final String details = String.format( Locale.getDefault(), "Fail to create table '%s' with configuration: \n" + "'%s'\n" + "KafkaCustConsumer '%s' is invalid", name, operand, custConsumerClass); throw new RuntimeException(details, e); } } return new KafkaStreamTable(tableOptionBuilder); }

Target:
@Override public KafkaStreamTable create(SchemaPlus schema, String name, Map<String, Object> operand, RelDataType rowType) { KafkaTableOptions tableOptionBuilder = new KafkaTableOptions(); tableOptionBuilder.setBootstrapServers( (String) operand.getOrDefault(KafkaTableConstants.SCHEMA_BOOTSTRAP_SERVERS, null)); tableOptionBuilder.setTopicName( (String) operand.getOrDefault(KafkaTableConstants.SCHEMA_TOPIC_NAME, null)); KafkaRowConverter rowConverter = null; if (operand.containsKey(KafkaTableConstants.SCHEMA_ROW_CONVERTER)) { String rowConverterClass = (String) operand.get(KafkaTableConstants.SCHEMA_ROW_CONVERTER); try { rowConverter = (KafkaRowConverter) Class.forName(rowConverterClass).newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { final String details = String.format( Locale.ROOT, "Fail to create table '%s' with configuration: \n" + "'%s'\n" + "KafkaRowConverter '%s' is invalid", name, operand, rowConverterClass); throw new RuntimeException(details, e); } } else { rowConverter = new KafkaRowConverterImpl(); } tableOptionBuilder.setRowConverter(rowConverter); if (operand.containsKey(KafkaTableConstants.SCHEMA_CONSUMER_PARAMS)) { tableOptionBuilder.setConsumerParams((Map<String, String>) operand.get( KafkaTableConstants.SCHEMA_CONSUMER_PARAMS)); } if (operand.containsKey(KafkaTableConstants.SCHEMA_CUST_CONSUMER)) { String custConsumerClass = (String) operand.get(KafkaTableConstants.SCHEMA_CUST_CONSUMER); try { tableOptionBuilder.setConsumer( (Consumer) Class.forName(custConsumerClass) .getConstructor(OffsetResetStrategy.class) .newInstance(OffsetResetStrategy.NONE) ); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { final String details = String.format( Locale.ROOT, "Fail to create table '%s' with configuration: \n" + "'%s'\n" + "KafkaCustConsumer '%s' is invalid", name, operand, custConsumerClass); throw new RuntimeException(details, e); } } return new KafkaStreamTable(tableOptionBuilder); }