test_class.declarator: topPaginationContextEngine
test_class.modifier: private
test_class.original_string: private TopPaginationContextEngine topPaginationContextEngine;
test_class.type: TopPaginationContextEngine
test_class.var_name: topPaginationContextEngine
test_class.file: shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/segment/select/pagination/engine/TopPaginationContextEngineTest.java
test_class.identifier: TopPaginationContextEngineTest
test_case.body: @Test
      public void assertCreatePaginationContextWhenParameterMarkerRowNumberValueSegment() {
          String name = "rowNumberAlias";
          ColumnSegment left = new ColumnSegment(0, 10, new IdentifierValue(name));
          ParameterMarkerExpressionSegment right = new ParameterMarkerExpressionSegment(0, 10, 0);
          BinaryOperationExpression expression = new BinaryOperationExpression(0, 0, left, right, ">", null);
          PaginationContext paginationContext = topPaginationContextEngine.createPaginationContext(new TopProjectionSegment(0, 10, null, name), expression, Collections.singletonList(1));
          assertTrue(paginationContext.getOffsetSegment().isPresent());
          PaginationValueSegment paginationValueSegment = paginationContext.getOffsetSegment().get();
          assertThat(paginationValueSegment, instanceOf(ParameterMarkerRowNumberValueSegment.class));
          ParameterMarkerRowNumberValueSegment parameterMarkerRowNumberValueSegment = (ParameterMarkerRowNumberValueSegment) paginationValueSegment;
          assertThat(parameterMarkerRowNumberValueSegment.getStartIndex(), is(0));
          assertThat(parameterMarkerRowNumberValueSegment.getStopIndex(), is(10));
          assertThat(parameterMarkerRowNumberValueSegment.getParameterIndex(), is(0));
          assertFalse(paginationContext.getRowCountSegment().isPresent());
      }
test_case.class_method_signature: TopPaginationContextEngineTest.assertCreatePaginationContextWhenParameterMarkerRowNumberValueSegment()
test_case.full_signature: @Test public void assertCreatePaginationContextWhenParameterMarkerRowNumberValueSegment()
test_case.identifier: assertCreatePaginationContextWhenParameterMarkerRowNumberValueSegment
test_case.invocations: createPaginationContext singletonList assertTrue isPresent getOffsetSegment get getOffsetSegment assertThat instanceOf assertThat getStartIndex is assertThat getStopIndex is assertThat getParameterIndex is assertFalse isPresent getRowCountSegment
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertCreatePaginationContextWhenParameterMarkerRowNumberValueSegment()
focal_class.file: shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/pagination/engine/TopPaginationContextEngine.java
focal_class.identifier: TopPaginationContextEngine
focal_class.class_method_signature: TopPaginationContextEngine.createPaginationContext(final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters)
focal_class.full_signature: public PaginationContext createPaginationContext(final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters)
focal_class.identifier: createPaginationContext
focal_class.modifiers: public
focal_class.parameters: (final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters)
focal_class.return: PaginationContext
focal_class.signature: PaginationContext createPaginationContext(final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters)
focal_class.class_method_signature: TopPaginationContextEngine.getRowNumberPredicate(final Collection<AndPredicate> andPredicates, final String rowNumberAlias)
focal_class.full_signature: private Optional<ExpressionSegment> getRowNumberPredicate(final Collection<AndPredicate> andPredicates, final String rowNumberAlias)
focal_class.identifier: getRowNumberPredicate
focal_class.modifiers: private
focal_class.parameters: (final Collection<AndPredicate> andPredicates, final String rowNumberAlias)
focal_class.return: Optional<ExpressionSegment>
focal_class.signature: Optional<ExpressionSegment> getRowNumberPredicate(final Collection<AndPredicate> andPredicates, final String rowNumberAlias)
focal_class.class_method_signature: TopPaginationContextEngine.isRowNumberColumn(final ExpressionSegment predicate, final String rowNumberAlias)
focal_class.full_signature: private boolean isRowNumberColumn(final ExpressionSegment predicate, final String rowNumberAlias)
focal_class.identifier: isRowNumberColumn
focal_class.modifiers: private
focal_class.parameters: (final ExpressionSegment predicate, final String rowNumberAlias)
focal_class.return: boolean
focal_class.signature: boolean isRowNumberColumn(final ExpressionSegment predicate, final String rowNumberAlias)
focal_class.class_method_signature: TopPaginationContextEngine.isCompareCondition(final ExpressionSegment predicate)
focal_class.full_signature: private boolean isCompareCondition(final ExpressionSegment predicate)
focal_class.identifier: isCompareCondition
focal_class.modifiers: private
focal_class.parameters: (final ExpressionSegment predicate)
focal_class.return: boolean
focal_class.signature: boolean isCompareCondition(final ExpressionSegment predicate)
focal_class.class_method_signature: TopPaginationContextEngine.createOffsetWithRowNumber(final ExpressionSegment predicateSegment)
focal_class.full_signature: private Optional<PaginationValueSegment> createOffsetWithRowNumber(final ExpressionSegment predicateSegment)
focal_class.identifier: createOffsetWithRowNumber
focal_class.modifiers: private
focal_class.parameters: (final ExpressionSegment predicateSegment)
focal_class.return: Optional<PaginationValueSegment>
focal_class.signature: Optional<PaginationValueSegment> createOffsetWithRowNumber(final ExpressionSegment predicateSegment)
focal_class.class_method_signature: TopPaginationContextEngine.createRowNumberValueSegment(final ExpressionSegment expression, final boolean boundOpened)
focal_class.full_signature: private RowNumberValueSegment createRowNumberValueSegment(final ExpressionSegment expression, final boolean boundOpened)
focal_class.identifier: createRowNumberValueSegment
focal_class.modifiers: private
focal_class.parameters: (final ExpressionSegment expression, final boolean boundOpened)
focal_class.return: RowNumberValueSegment
focal_class.signature: RowNumberValueSegment createRowNumberValueSegment(final ExpressionSegment expression, final boolean boundOpened)
focal_method.body: public PaginationContext createPaginationContext(final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters) {
          Collection<AndPredicate> andPredicates = new ExpressionBuilder(where).extractAndPredicates().getAndPredicates();
          Optional<ExpressionSegment> rowNumberPredicate = null != where ? getRowNumberPredicate(andPredicates, topProjectionSegment.getAlias()) : Optional.empty();
          Optional<PaginationValueSegment> offset = rowNumberPredicate.isPresent() ? createOffsetWithRowNumber(rowNumberPredicate.get()) : Optional.empty();
          PaginationValueSegment rowCount = topProjectionSegment.getTop();
          return new PaginationContext(offset.orElse(null), rowCount, parameters);
      }
focal_method.class_method_signature: TopPaginationContextEngine.createPaginationContext(final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters)
focal_method.full_signature: public PaginationContext createPaginationContext(final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters)
focal_method.identifier: createPaginationContext
focal_method.invocations: getAndPredicates extractAndPredicates getRowNumberPredicate getAlias empty isPresent createOffsetWithRowNumber get empty getTop orElse
focal_method.modifiers: public
focal_method.parameters: (final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters)
focal_method.return: PaginationContext
focal_method.signature: PaginationContext createPaginationContext(final TopProjectionSegment topProjectionSegment, final ExpressionSegment where, final List<Object> parameters)