Skip to content

[Inprovement](consts): Use inline variable#19301

Closed
happysnaker wants to merge 1 commit intoapache:masterfrom
happysnaker:master
Closed

[Inprovement](consts): Use inline variable#19301
happysnaker wants to merge 1 commit intoapache:masterfrom
happysnaker:master

Conversation

@happysnaker
Copy link

https://en.cppreference.com/w/cpp/language/inline

Proposed changes

Issue Number: close #xxx

Problem summary

Describe your changes.

Checklist(Required)

  • Does it affect the original behavior
  • Has unit tests been added
  • Has document been added or modified
  • Does it need to update dependencies
  • Is this PR support rollback (If NO, please explain WHY)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

const std::string ROW_STORE_COL = "__DORIS_ROW_STORE_COL__";
const std::string DYNAMIC_COLUMN_NAME = "__DORIS_DYNAMIC_COL__";

inline const std::string CSV = "csv";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline const std::string CSV = "csv";
^

const std::string DYNAMIC_COLUMN_NAME = "__DORIS_DYNAMIC_COL__";

inline const std::string CSV = "csv";
inline const std::string CSV_WITH_NAMES = "csv_with_names";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline const std::string CSV_WITH_NAMES = "csv_with_names";
^


inline const std::string CSV = "csv";
inline const std::string CSV_WITH_NAMES = "csv_with_names";
inline const std::string CSV_WITH_NAMES_AND_TYPES = "csv_with_names_and_types";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline const std::string CSV_WITH_NAMES_AND_TYPES = "csv_with_names_and_types";
^

inline const std::string CSV = "csv";
inline const std::string CSV_WITH_NAMES = "csv_with_names";
inline const std::string CSV_WITH_NAMES_AND_TYPES = "csv_with_names_and_types";
inline const std::string BLOCK_TEMP_COLUMN_PREFIX = "__TEMP__";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline const std::string BLOCK_TEMP_COLUMN_PREFIX = "__TEMP__";
^

inline const std::string CSV_WITH_NAMES = "csv_with_names";
inline const std::string CSV_WITH_NAMES_AND_TYPES = "csv_with_names_and_types";
inline const std::string BLOCK_TEMP_COLUMN_PREFIX = "__TEMP__";
inline const std::string ROWID_COL = "__DORIS_ROWID_COL__";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline const std::string ROWID_COL = "__DORIS_ROWID_COL__";
^

inline const std::string CSV_WITH_NAMES_AND_TYPES = "csv_with_names_and_types";
inline const std::string BLOCK_TEMP_COLUMN_PREFIX = "__TEMP__";
inline const std::string ROWID_COL = "__DORIS_ROWID_COL__";
inline const std::string ROW_STORE_COL = "__DORIS_ROW_STORE_COL__";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline const std::string ROW_STORE_COL = "__DORIS_ROW_STORE_COL__";
^

inline const std::string BLOCK_TEMP_COLUMN_PREFIX = "__TEMP__";
inline const std::string ROWID_COL = "__DORIS_ROWID_COL__";
inline const std::string ROW_STORE_COL = "__DORIS_ROW_STORE_COL__";
inline const std::string DYNAMIC_COLUMN_NAME = "__DORIS_DYNAMIC_COL__";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline const std::string DYNAMIC_COLUMN_NAME = "__DORIS_DYNAMIC_COL__";
^

constexpr int MAX_DECIMAL32_PRECISION = 9;
constexpr int MAX_DECIMAL64_PRECISION = 18;
constexpr int MAX_DECIMAL128_PRECISION = 38;
inline constexpr int MAX_DECIMAL32_PRECISION = 9;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline constexpr int MAX_DECIMAL32_PRECISION = 9;
^

constexpr int MAX_DECIMAL64_PRECISION = 18;
constexpr int MAX_DECIMAL128_PRECISION = 38;
inline constexpr int MAX_DECIMAL32_PRECISION = 9;
inline constexpr int MAX_DECIMAL64_PRECISION = 18;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline constexpr int MAX_DECIMAL64_PRECISION = 18;
^

constexpr int MAX_DECIMAL128_PRECISION = 38;
inline constexpr int MAX_DECIMAL32_PRECISION = 9;
inline constexpr int MAX_DECIMAL64_PRECISION = 18;
inline constexpr int MAX_DECIMAL128_PRECISION = 38;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inline variables are a C++17 extension [clang-diagnostic-c++17-extensions]

inline constexpr int MAX_DECIMAL128_PRECISION = 38;
^

@adonis0147
Copy link
Contributor

Hi @happysnaker , please re-format the changes due to the check failed. See https://github.com/apache/doris/actions/runs/4890195881/jobs/8749820436?pr=19301

@github-actions
Copy link
Contributor

We're closing this PR because it hasn't been updated in a while.
This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Nov 20, 2023
@github-actions github-actions bot closed this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants