Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG] CLI yields wrong results on a query

未关闭
#2 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python, sql
领域
cli

调研方向

使用提供的 curl 命令和 SQL 查询重现该问题,然后在第二次运行时比较垂直输出与表格输出。检查 cli.log、curl.log、网络转储和附加的环境详细信息,尤其是 LESS 设置。当重复查询显示相同的 10 行,且没有空白行或过时结果时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug

What is the bug?
opensearchsqlcli tool yields wrong results for a query. Perhaps, it shows results from a previous query.

How can one reproduce the bug?

  1. Load this data using curl:
curl -s -XPOST localhost:9200/_bulk -H 'Content-Type: application/x-ndjson' --data-binary @beer.stackexchange3.txt

beer.stackexchange3.txt

  1. Run query
select * from beer.stackexchange where Tags like '% % %' and Title like '%' LIMIT 10;
  1. Type y to see results vertically
    OK there are 10 entries
  2. Run the same query and hit Enter to see the results table
    There are 25 lines !
    Pay attention to mismatch on the first row and on the row count. There is no row wrap.
      1 fetched rows / total rows = 10/10
      2 +------------+-------------------------+----------------------+---------------------------------------------------------------------------------------+-------------+------->
      3 | ParentId   | CreationDate            | CommunityOwnedDate   | Title                                                                                 | ViewCount   | LastEd>
      4 |------------+-------------------------+----------------------+---------------------------------------------------------------------------------------+-------------+------->
      5 | null       | 2014-01-21 20:37:12.143 | null                 | What is the difference between an ale and a lager?                                    | 40787       | null  >
      6 | null       | 2014-01-21 20:45:28.747 | null                 | Why doesn't bottled beer taste as good as draught beer?                               | 3867        | null  >
      7 |            |                         |                      |                                                                                       |             |       >
      8 |            |                         |                      |                                                                                       |             |       >
      9 |            |                         |                      |                                                                                       |             |       >
     10 |            |                         |                      |                                                                                       |             |       >
     11 | null       | 2014-01-21 20:48:46.88  | null                 | Can one pilsener cause a hangover when another doesn't?                               | 875         | null  >
     12 |            |                         |                      |                                                                                       |             |       >
     13 |            |                         |                      |                                                                                       |             |       >
     14 | null       | 2014-01-21 20:50:01.62  | null                 | Do different beer glass shapes really make a difference in taste?                     | 5270        | null  >
     15 |            |                         |                      |                                                                                       |             |       >
     16 |            |                         |                      |                                                                                       |             |       >
     17 | null       | 2014-01-21 20:59:16.81  | null                 | How can I prolong the life of beer in a growler?                                      | 996         | 73    >
     18 | null       | 2014-01-21 21:00:23.103 | null                 | What's the difference between a porter and a stout?                                   | 2887        | 73    >
     19 |            |                         |                      |                                                                                       |             |       >
     20 |            |                         |                      |                                                                                       |             |       >
     21 | null       | 2014-01-21 21:05:17.293 | null                 | Why is it called "porter"?                                                            | 764         | 407   >
     22 | null       | 2014-01-21 21:17:49.747 | null                 | How much of an impact does the water have on a beer?                                  | 1870        | 52    >
     23 | null       | 2014-01-21 21:22:24.927 | null                 | Why does Guinness have a special pouring process / bottle, while other stouts do not? | 1804        | null  >
     24 | null       | 2014-01-21 21:55:27.83  | null                 | Where can I buy Czech beers in Bavaria?                                               | 86          | 43    >
     25 |            |                         |                      |                                                                                       |             |       >
     26 |            |                         |                      |                                                                                       |             |       >
     27 |            |                         |                      |                                                                                       |             |       >
     28 |            |                         |                      |                                                                                       |             |       >
     29 +------------+-------------------------+----------------------+---------------------------------------------------------------------------------------+-------------+------->
(END)

What is the expected behavior?
A clear and concise description of what you expected to happen.

What is your host/environment?
Server: OpenSearch 2.0.0-rc1-SNAPSHOT
CLI Version: 1.0.0
OS: WSL 2.0 on Win 11
Python: 3.8.10
env vars: env.txt
The most interesting i guess are:

LESS=-RSNF
LESSOPEN='|~/.lessfilter %s'

Additional information
Process core dump:
cli_full.zip
Network traffic dump:
dump.zip
CLI log:
cli.log
CURL returns valid output:
curl.log

Note: I didn't execute a query that returns 25 lines.

主要语言
Python
星标
9
派生
24
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

opensearch-project/sql-cli 的其他 Issue

查看 opensearch-project/sql-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。