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

Support HerdDB database #194

Merged
merged 3 commits into from
Sep 19, 2019
Merged

Support HerdDB database #194

merged 3 commits into from
Sep 19, 2019

Conversation

eolivelli
Copy link
Contributor

@eolivelli eolivelli commented Sep 17, 2019

  • Add HerdDB JDBC driver (works for tests, accessing a standalone server, accessing a cluster, running the server in the same process of the backend)
  • Change all of the DELETE statements to use a syntax supported by Apache Calcite (SQL interpreter of HerdDB)
  • Use time_stamp in SQL, and getTimestamp() in beans (there is no way to have a unique sintax to escape keyword 'timestamp' that works for MySQL/HerdDB and PostGre)
  • Run tests with HerdDB instead of SQLLite
  • add demo configuration for HerdDB
  • upgrade Lombok

@eolivelli
Copy link
Contributor Author

@tuteng I still have a failing test so this patch is not ready to go.

I also have a bad problem with the aliases 'timestamp', that is not supported by Apache Calcite.
When we were MySQL-friendly we could use the 'accent' escape of MySQL (´) but I think this is not supported by PostGres.
I think you used all the 'AS' syntaxes in order to map 1:1 the query to the java beans without renaming timestamp to time_stamp every where in the frontend.

I am trying to find a fix, byt if you have an idea about how to fix it please chime in

cc @sijie

@sijie
Copy link
Member

sijie commented Sep 18, 2019

@eolivelli what is the difference between #183 and this one?

@eolivelli
Copy link
Contributor Author

@sijie I had to start from scratch because of too many conflicts as the schema changes dramatically and so every SQL query was rewritten.
The only big addition is that I have moved the tests to HerdDB.

@eolivelli
Copy link
Contributor Author

@sijie @tuteng all tests are passing.
The frontend seems to work even if I have renamed 'timestamp' to 'time_stamp' on every Stat bean.
I tried to check for direct usages of property "frontend" in the JS code but I did not find any explicit reference.

@eolivelli
Copy link
Contributor Author

I had to upgrade Lombok in order to make my IDE happy, I can revert that part of the change

#spring.datasource.password=

# HerdDB JDBC Driver
spring.datasource.driver-class-name=herddb.jdbc.Driver
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is now the default

# HerdDB JDBC Driver
spring.datasource.driver-class-name=herddb.jdbc.Driver
HerdDB - local in memory-only (check docs for starting an embedded server or embedded replicated server)
spring.datasource.url=jdbc:herddb:local
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is in-memory only

@eolivelli
Copy link
Contributor Author

@sijie @tuteng the patch is good to go

@sijie
Copy link
Member

sijie commented Sep 18, 2019

The change looks good to me. @tuteng can you please also take a look?

@tuteng
Copy link
Member

tuteng commented Sep 19, 2019

@eolivelli Thank you very much for your contribution. There is no problem with the tests on my side. It works very well. Is it convenient for you to add some instructions on the default test database to this document https://github.com/streamnative/pulsar-manager/blob/master/src/README.md?

Similar to the following:

Default Test database HerdDB

Introduction

A brief introduction

Document Link: herddb-link

@tuteng tuteng merged commit 44273c9 into apache:master Sep 19, 2019
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.

None yet

3 participants