test_class.declarator: segment
test_class.modifier: private
test_class.original_string: private TableRuleSegment segment;
test_class.type: TableRuleSegment
test_class.var_name: segment
test_class.declarator: context
test_class.modifier: private
test_class.original_string: private CreateShardingRuleStatementContext context;
test_class.type: CreateShardingRuleStatementContext
test_class.var_name: context
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/convert/CreateShardingRuleStatementContextConverterTest.java
test_class.identifier: CreateShardingRuleStatementContextConverterTest
test_case.body: @Test
      public void generate() {
          YamlShardingRuleConfiguration rule = new CreateShardingRuleStatementContextConverter().convert(context);
          assertTrue(rule.getTables().isEmpty());
          assertThat(rule.getAutoTables().size(), is(1));
          assertThat(rule.getAutoTables().get(segment.getLogicTable()).getActualDataSources(), is("ds0,ds1"));
          assertThat(rule.getAutoTables().get(segment.getLogicTable()).getShardingStrategy().getStandard().getShardingColumn(), is("order_id"));
          assertThat(rule.getAutoTables().get(segment.getLogicTable()).getShardingStrategy().getStandard().getShardingAlgorithmName(), is("t_order_MOD"));
          assertTrue(rule.getShardingAlgorithms().containsKey("t_order_MOD"));
          assertThat(rule.getShardingAlgorithms().get("t_order_MOD").getType(), is("MOD"));
      }
test_case.class_method_signature: CreateShardingRuleStatementContextConverterTest.generate()
test_case.full_signature: @Test public void generate()
test_case.identifier: generate
test_case.invocations: convert assertTrue isEmpty getTables assertThat size getAutoTables is assertThat getActualDataSources get getAutoTables getLogicTable is assertThat getShardingColumn getStandard getShardingStrategy get getAutoTables getLogicTable is assertThat getShardingAlgorithmName getStandard getShardingStrategy get getAutoTables getLogicTable is assertTrue containsKey getShardingAlgorithms assertThat getType get getShardingAlgorithms is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void generate()
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/convert/CreateShardingRuleStatementContextConverter.java
focal_class.identifier: CreateShardingRuleStatementContextConverter
focal_class.interfaces: implements SQLStatementContextConverter<CreateShardingRuleStatementContext, YamlShardingRuleConfiguration>
focal_class.class_method_signature: CreateShardingRuleStatementContextConverter.convert(final CreateShardingRuleStatementContext context)
focal_class.full_signature: @Override public YamlShardingRuleConfiguration convert(final CreateShardingRuleStatementContext context)
focal_class.identifier: convert
focal_class.modifiers: @Override public
focal_class.parameters: (final CreateShardingRuleStatementContext context)
focal_class.return: YamlShardingRuleConfiguration
focal_class.signature: YamlShardingRuleConfiguration convert(final CreateShardingRuleStatementContext context)
focal_class.class_method_signature: CreateShardingRuleStatementContextConverter.createAlgorithmConfiguration(final TableRuleSegment segment, final Properties properties)
focal_class.full_signature: private YamlShardingSphereAlgorithmConfiguration createAlgorithmConfiguration(final TableRuleSegment segment, final Properties properties)
focal_class.identifier: createAlgorithmConfiguration
focal_class.modifiers: private
focal_class.parameters: (final TableRuleSegment segment, final Properties properties)
focal_class.return: YamlShardingSphereAlgorithmConfiguration
focal_class.signature: YamlShardingSphereAlgorithmConfiguration createAlgorithmConfiguration(final TableRuleSegment segment, final Properties properties)
focal_class.class_method_signature: CreateShardingRuleStatementContextConverter.createAutoTableRuleConfiguration(final TableRuleSegment segment)
focal_class.full_signature: private YamlShardingAutoTableRuleConfiguration createAutoTableRuleConfiguration(final TableRuleSegment segment)
focal_class.identifier: createAutoTableRuleConfiguration
focal_class.modifiers: private
focal_class.parameters: (final TableRuleSegment segment)
focal_class.return: YamlShardingAutoTableRuleConfiguration
focal_class.signature: YamlShardingAutoTableRuleConfiguration createAutoTableRuleConfiguration(final TableRuleSegment segment)
focal_class.class_method_signature: CreateShardingRuleStatementContextConverter.createStrategyConfiguration(final TableRuleSegment segment)
focal_class.full_signature: private YamlShardingStrategyConfiguration createStrategyConfiguration(final TableRuleSegment segment)
focal_class.identifier: createStrategyConfiguration
focal_class.modifiers: private
focal_class.parameters: (final TableRuleSegment segment)
focal_class.return: YamlShardingStrategyConfiguration
focal_class.signature: YamlShardingStrategyConfiguration createStrategyConfiguration(final TableRuleSegment segment)
focal_class.class_method_signature: CreateShardingRuleStatementContextConverter.getAlgorithmName(final String tableName, final String algorithmType)
focal_class.full_signature: private String getAlgorithmName(final String tableName, final String algorithmType)
focal_class.identifier: getAlgorithmName
focal_class.modifiers: private
focal_class.parameters: (final String tableName, final String algorithmType)
focal_class.return: String
focal_class.signature: String getAlgorithmName(final String tableName, final String algorithmType)
focal_method.body: @Override
      public YamlShardingRuleConfiguration convert(final CreateShardingRuleStatementContext context) {
          YamlShardingRuleConfiguration result = new YamlShardingRuleConfiguration();
          for (TableRuleSegment each : context.getSqlStatement().getTables()) {
              result.getShardingAlgorithms().put(getAlgorithmName(each.getLogicTable(), each.getAlgorithmType()),
                      createAlgorithmConfiguration(each, context.getAlgorithmProperties(each)));
              result.getAutoTables().put(each.getLogicTable(), createAutoTableRuleConfiguration(each));
          }
          return result;
      }
focal_method.class_method_signature: CreateShardingRuleStatementContextConverter.convert(final CreateShardingRuleStatementContext context)
focal_method.full_signature: @Override public YamlShardingRuleConfiguration convert(final CreateShardingRuleStatementContext context)
focal_method.identifier: convert
focal_method.invocations: getTables getSqlStatement put getShardingAlgorithms getAlgorithmName getLogicTable getAlgorithmType createAlgorithmConfiguration getAlgorithmProperties put getAutoTables getLogicTable createAutoTableRuleConfiguration
focal_method.modifiers: @Override public
focal_method.parameters: (final CreateShardingRuleStatementContext context)
focal_method.return: YamlShardingRuleConfiguration
focal_method.signature: YamlShardingRuleConfiguration convert(final CreateShardingRuleStatementContext context)