-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
First draft of Mongodb plugin #3337
Conversation
This looks awesome! Very complete docs, too! Nit: the preferred capitalization, from looking at their website, seems to be "MongoDB" |
{ | ||
super(session, workers); | ||
|
||
server = new MongoServer(new SyncMemoryBackend()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! An in-memory Java MongoDB server.
0b12107
to
c4460e4
Compare
``mongodb.schema-collection`` | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
As the MongoDB is a document database, there's no fixed schema information in the system. So a special collection in each MongoDB database should defines the schema of all tables. Please refer the Table definitions section for the details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the :ref: tag for referencing Table definitions section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip.
looks good |
import static com.facebook.presto.metadata.OperatorType.EQUAL; | ||
import static com.facebook.presto.metadata.OperatorType.NOT_EQUAL; | ||
|
||
public class ObjectIdFunctions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I merged the changes in this PR with tag 0.122 and attempted to run on my MongoDB instance. The server threw:
2015-10-14T16:09:54.669-0400 ERROR main com.facebook.presto.server.PrestoServer [GREATER_THAN, BETWEEN, LESS_THAN_OR_EQUAL, GREATER_THAN_OR_EQUAL, HASH_CODE, LESS_THAN] missing for ObjectId
java.lang.IllegalStateException: [GREATER_THAN, BETWEEN, LESS_THAN_OR_EQUAL, GREATER_THAN_OR_EQUAL, HASH_CODE, LESS_THAN] missing for ObjectId
at com.facebook.presto.metadata.MetadataManager.verifyComparableOrderableContract(MetadataManager.java:227)
at com.facebook.presto.server.PluginManager.loadPlugins(PluginManager.java:157)
at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:111)
at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:62)
I added the missing ObjectId
operators to ObjectIdFunctions
and now have a running presto server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. I've added missing operators GREATER_THAN, BETWEEN, LESS_THAN_OR_EQUAL, GREATER_THAN_OR_EQUAL, HASH_CODE, LESS_THAN
72846c8
to
e98a65c
Compare
I've rebased on 0.123-SNAPSHOT and fixed various typos in the document. |
@electrum, apologies if I'm missing something. Is there a merge plan for this? |
@gonewandering yes, we're super backlogged processing pull requests, but this is definitely on our list. |
@martint, awesome. Thanks. Looking forward |
Hi, I am using this as a plugin, with my current version of PrestoDB, and may have found a bug. When creating a schema for a collection, the connector fails with error whenever the db collection has a field name with a mixture or lower-case and upper-case characters. If I rename the field in the collection to be all lower-case, the queries then work fine. This has to be tested with a MongoDB server hosted on a case-sensitive O/S like Linux. The problem does not happen when I use a MongoDB on OSX, which has a case-insensitive file system. |
Can you rebase on latest master? |
Merged, thanks! |
No description provided.