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

First draft of Mongodb plugin #3337

Closed
wants to merge 1 commit into from
Closed

Conversation

miniway
Copy link
Contributor

@miniway miniway commented Jul 23, 2015

No description provided.

@electrum
Copy link
Contributor

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());
Copy link
Contributor

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.

``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.
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the tip.

@akshatnair
Copy link
Member

looks good

import static com.facebook.presto.metadata.OperatorType.EQUAL;
import static com.facebook.presto.metadata.OperatorType.NOT_EQUAL;

public class ObjectIdFunctions
Copy link

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.

Copy link
Contributor Author

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

@miniway miniway force-pushed the mongodb branch 2 times, most recently from 72846c8 to e98a65c Compare October 19, 2015 19:35
@miniway
Copy link
Contributor Author

miniway commented Oct 19, 2015

I've rebased on 0.123-SNAPSHOT and fixed various typos in the document.

@gonewandering
Copy link

@electrum, apologies if I'm missing something. Is there a merge plan for this?

@martint
Copy link
Contributor

martint commented Jan 20, 2016

@gonewandering yes, we're super backlogged processing pull requests, but this is definitely on our list.

@gonewandering
Copy link

@martint, awesome. Thanks. Looking forward

@milespoindexter
Copy link

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.

@martint
Copy link
Contributor

martint commented Apr 15, 2016

Can you rebase on latest master?

@martint
Copy link
Contributor

martint commented Apr 22, 2016

Merged, thanks!

@martint martint closed this Apr 22, 2016
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

8 participants