Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES与OpenSearch数据源添加SQL语句支持-v0.6-beta #2761

Merged
merged 35 commits into from
Aug 19, 2024

Conversation

feiazifeiazi
Copy link
Contributor

@feiazifeiazi feiazifeiazi commented Aug 16, 2024

添加SQL语句查询支持。

# ES SQL查询语句示例:

select * from dmp__iv limit 33;

SELECT CreateTime,* FROM dmp__iv  order by CreateTime desc LIMIT 111;

SELECT d.CreateTime Ct,* FROM dmp__iv d order by d.CreateTime desc LIMIT 111;

SELECT d.CreateTime,* FROM dmp__iv as d
 where DataSource='sit-db90.db.mib'
 order by CreateTime desc limit 100;

# OpenSarch SQL查询语句示例:

 select * from dmp__iv limit 33;

SELECT d.CreateTime,d.* FROM dmp__iv d order by d.CreateTime desc LIMIT 111;

SELECT d.CreateTime Ct,d.* FROM dmp__iv d order by d.CreateTime desc LIMIT 111;

SELECT d.CreateTime,d.* FROM dmp__iv as d
 where DataSource='sit-db95.db.mib'
 order by CreateTime desc limit 100;


PS: 2种数据库的SQL语句在别名处理上不一样,OpenSeach会更好一点。
# ES与OpenSearch API查询语句示例:
get /_cat/indices
get /_cat/indices/dmp*?v&s=docs.count:desc
GET dmp__iv/_search

GET dmp__iv/_search?
{
  "query": {

    "match_all": {}
  },

  "sort": [
    {
      "CreateTime": {
        "order": "desc"
      }
    }
  ]
  ,"_source": ["DataSource", "CreateTime"]
  , "size": 5

}

@feiazifeiazi feiazifeiazi changed the title ES与OpenSearch数据源添加SQL语句支持 ES与OpenSearch数据源添加SQL语句支持-v0.6-beta Aug 16, 2024
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 94.47514% with 10 lines in your changes missing coverage. Please review.

Project coverage is 77.82%. Comparing base (e8c8869) to head (337aff7).
Report is 1 commits behind head on master.

Files Patch % Lines
sql/engines/elasticsearch.py 91.45% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2761      +/-   ##
==========================================
+ Coverage   77.67%   77.82%   +0.15%     
==========================================
  Files         122      122              
  Lines       16723    16855     +132     
==========================================
+ Hits        12989    13117     +128     
- Misses       3734     3738       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LeoQuote
Copy link
Collaborator

可以精简下, rebase 下代码, 现在有冲突合不了, 试一下 reset --soft 到 上游的master 分支然后重新 commit push

@feiazifeiazi
Copy link
Contributor Author

可以精简下, rebase 下代码, 现在有冲突合不了, 试一下 reset --soft 到 上游的master 分支然后重新 commit push

1

@LeoQuote LeoQuote merged commit 84e5f83 into hhyo:master Aug 19, 2024
10 checks passed
feiazifeiazi added a commit to feiazifeiazi/Archery_Genuine2 that referenced this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants