You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// prepare sql plans, each contain the corresponding index scan execution node for the orderby expression.
619
-
for ( std::string exp : orderby_expressions) {
633
+
for (std::string exp : orderby_expressions) {
634
+
parseVectorConstant(exp);
620
635
DEBUG_PRINT("Prepare IndexScan node for orderby_expresion: %s ", exp.c_str());
621
636
622
637
char sourceText[102400];
623
638
624
-
if (orderby_expressions.size() == 1)
625
-
{
626
-
if ( strlen(text_to_cstring(filter_exp_text)) == 0){
639
+
if (orderby_expressions.size() == 1) {
640
+
if (strlen(text_to_cstring(filter_exp_text)) == 0) {
627
641
snprintf(sourceText, sizeof(sourceText), "select %s from %s order by %s", text_to_cstring(attr_exp_text), text_to_cstring(tablename), exp.c_str());
628
642
} else {
629
643
snprintf(sourceText, sizeof(sourceText), "select %s from %s where %s order by %s", text_to_cstring(attr_exp_text), text_to_cstring(tablename), text_to_cstring(filter_exp_text), exp.c_str());
630
644
}
631
-
} else{
632
-
if (strlen(text_to_cstring(filter_exp_text)) == 0){
645
+
} else{
646
+
if (strlen(text_to_cstring(filter_exp_text)) == 0){
633
647
snprintf(sourceText, sizeof(sourceText), "select %s, %s from %s order by %s", text_to_cstring(attr_exp_text), rank_exp.c_str(), text_to_cstring(tablename), exp.c_str());
634
648
} else {
635
649
snprintf(sourceText, sizeof(sourceText), "select %s, %s from %s where %s order by %s", text_to_cstring(attr_exp_text), rank_exp.c_str(), text_to_cstring(tablename), text_to_cstring(filter_exp_text), exp.c_str());
@@ -638,7 +652,7 @@ Datum topk(PG_FUNCTION_ARGS) {
638
652
639
653
PlannedStmt* plan = NULL;
640
654
641
-
if (!(plan = extractIndexScanNode(sourceText))){
655
+
if (!(plan = extractIndexScanNode(sourceText))){
642
656
elog(ERROR, "cannot find index for order by expr = %s", sourceText);
0 commit comments