Skip to content

Commit

Permalink
Merge pull request #142 from qidi1/remove_parser
Browse files Browse the repository at this point in the history
use sqlgpt-parser package
  • Loading branch information
qidi1 authored Sep 8, 2023
2 parents 73273cb + 8e7e680 commit 5ca0a43
Show file tree
Hide file tree
Showing 81 changed files with 76 additions and 123,767 deletions.
276 changes: 0 additions & 276 deletions docs/Parser 模块开发指南.md

This file was deleted.

Binary file removed docs/pictures/DELETE 语法树.png
Binary file not shown.
Binary file removed docs/pictures/parsing-overview.png
Binary file not shown.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'flasgger',
'ply==3.11',
'chardet==3.0.4',
'sqlgpt-parser>=0.0.1a2',
],
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand Down
4 changes: 2 additions & 2 deletions src/api/api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"""

from src.optimizer.optimizer import Optimizer
from src.parser.mysql_parser import parser as mysql_parser
from src.parser.parser_utils import ParserUtils
from sqlgpt_parser.sql_parser.mysql_parser import parser as mysql_parser
from sqlgpt_parser.sql_parser.parser_utils import ParserUtils
from src.common.utils import Utils


Expand Down
4 changes: 2 additions & 2 deletions src/api/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from src.common.utils import Utils
from src.metadata.metadata_utils import MetaDataUtils
from src.optimizer.optimizer import Optimizer as opt
from src.parser.mysql_parser import parser as mysql_parser
from src.parser.parser_utils import ParserUtils
from sqlgpt_parser.sql_parser.mysql_parser import parser as mysql_parser
from sqlgpt_parser.sql_parser.parser_utils import ParserUtils

NOTHING_TO_DO = 'Current table index is so good , nothing to do'

Expand Down
8 changes: 4 additions & 4 deletions src/consume/mysql_slowlog_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
from src.common.logger import Logger
from src.consume.file_parse_common import get_encoding
from src.consume.mysql_logparser_base import MysqlSlowLogParse
from src.optimizer.formatter import format_sql
from src.parser.mysql_parser.parser import parser as mysql_parser
from src.parser.mysql_parser.lexer import lexer as mysql_lexer
from src.parser.parser_utils import ParserUtils
from sqlgpt_parser.format.formatter import format_sql
from sqlgpt_parser.sql_parser.mysql_parser.parser import parser as mysql_parser
from sqlgpt_parser.sql_parser.mysql_parser.lexer import lexer as mysql_lexer
from sqlgpt_parser.sql_parser.parser_utils import ParserUtils

log_file = os.path.basename(sys.argv[0]).split(".")[0] + '.log'
log = Logger(log_file)
Expand Down
2 changes: 1 addition & 1 deletion src/metadata/metadata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from src.metadata.catalog import Catalog, Statistics, Selectivity, Table, Index, Column
from src.optimizer.optimizer_enum import IndexType, OptType
from src.parser.mysql_parser import parser as mysql_parser
from sqlgpt_parser.sql_parser.mysql_parser import parser as mysql_parser


class MetaDataUtils(object):
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/abstract_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from abc import ABCMeta, abstractmethod

from src.parser.tree.statement import Statement
from sqlgpt_parser.sql_parser.tree.statement import Statement


class AbstractRewriteRule(metaclass=ABCMeta):
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from typing import List

from src.optimizer.cbo.cbo import CBO
from src.parser.tree.statement import Statement
from sqlgpt_parser.sql_parser.tree.statement import Statement
from .heuristic_rule import heuristic_rule_list
from .pmd_rule import common_pmd_list

Expand Down
Loading

0 comments on commit 5ca0a43

Please sign in to comment.