Skip to content
This repository was archived by the owner on Aug 23, 2021. It is now read-only.

Clickhouse support #186

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

FrankSchmutz
Copy link

No description provided.

Copy link
Member

@apavlo apavlo left a comment

Choose a reason for hiding this comment

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

I've requested some minor fixes.

@dvanaken We should probably talk about some of the additional configuration parameters that we can move into DatabaseType. This DBMS doesn't support NULL so they use -1. It also requires the DB name to be prefixed in front of all column names.

@@ -312,6 +312,17 @@ protected int loadStock(Connection conn, int w_id, int numItems) {
+ TPCCUtil.randomStr(len - startORIGINAL - 9);
}

stock.s_dist_01 = TPCCUtil.randomStr(24);
Copy link
Member

Choose a reason for hiding this comment

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

Please rebase on the master branch to remove this regression.

@@ -592,7 +603,8 @@ protected int loadOrders(Connection conn, int w_id, int districtsPerWarehouse, i
if (oorder.o_carrier_id != null) {
ordrPrepStmt.setInt(idx++, oorder.o_carrier_id);
} else {
ordrPrepStmt.setNull(idx++, Types.INTEGER);
ordrPrepStmt.setInt(idx++, -1);
Copy link
Member

Choose a reason for hiding this comment

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

Is this Clickhouse specific? What does "-1" mean?

Copy link
Author

Choose a reason for hiding this comment

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

-1 is just an arbitrary choice. This is supposed to replace the null value but -1 might not be a good choice.

OL_SUPPLY_W_ID int,
OL_QUANTITY Float32,
OL_DIST_INFO FixedString(24),
EventDate Date DEFAULT toDate(now()),
Copy link
Member

Choose a reason for hiding this comment

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

Please make the column names match the case of the other columns in the table. Also, add comments that explain what this does and why it is needed.

@@ -352,7 +352,7 @@ public static String getInsertSQL(Table catalog_tbl) {
* @return
*/
public static String getInsertSQL(Table catalog_tbl, boolean escape_names, int...exclude_columns) {
return getInsertSQL(catalog_tbl, false, false, 1, exclude_columns);
return getInsertSQL(catalog_tbl, true, false, 1, exclude_columns);
Copy link
Member

Choose a reason for hiding this comment

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

This is Clickhouse specific, right? What part of the code needed this?

Copy link
Author

Choose a reason for hiding this comment

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

Yes this is so that the column names appear in the insert statements since we added two columns per table (we use the default values for those columns).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants