Phantom DSL scala.NotImplementedError
I'm using Phantom DSL (v2.28.0, scala v2.12.7) and upon each query to my database I receive the following ambiguous error:
scala.NotImplementedError: an implementation is missing
This doesn't happen when I use .future()
to resolve my query, in that case queries work just fine. Also, running a .executableQuery()
method returns a properly formatted query, which all points to my failure to build a model properly, but I don't get it what I'm doing wrong. Example queries:
Working queries:
db.entries.select.all.future // -> Returns a Future[ResultSet]
db.entries.select.where(_.user_id is userId).future() // -> ^
Failing queries:
db.entries.select.all.fetch // -> Err
db.entries.select.where(_.user_id is userId).fetch() // -> Err
db.entries.select.all.fetchRecord // -> Err
...
The same goes for paginateRecord() etc.
case class Rec(
id: UUID,
body: String,
time: DateTime,
user_id: Integer
)
abstract class active extends Table[active, Rec] {
object id extends UUIDColumn with PartitionKey
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
}
class BasicDatabase(override val connector: CassandraConnection) extends Database[BasicDatabase](connector) {
object entries extends active with Connector
}
implicit val keySpace: KeySpace = KeySpace("some_keyspace")
implicit val session: Session = db.session
object db extends BasicDatabase(CassandraConnector.default)
I'm still a newbie so any suggestions are useful, thanks in advance.
scala cassandra phantom-dsl
add a comment |
I'm using Phantom DSL (v2.28.0, scala v2.12.7) and upon each query to my database I receive the following ambiguous error:
scala.NotImplementedError: an implementation is missing
This doesn't happen when I use .future()
to resolve my query, in that case queries work just fine. Also, running a .executableQuery()
method returns a properly formatted query, which all points to my failure to build a model properly, but I don't get it what I'm doing wrong. Example queries:
Working queries:
db.entries.select.all.future // -> Returns a Future[ResultSet]
db.entries.select.where(_.user_id is userId).future() // -> ^
Failing queries:
db.entries.select.all.fetch // -> Err
db.entries.select.where(_.user_id is userId).fetch() // -> Err
db.entries.select.all.fetchRecord // -> Err
...
The same goes for paginateRecord() etc.
case class Rec(
id: UUID,
body: String,
time: DateTime,
user_id: Integer
)
abstract class active extends Table[active, Rec] {
object id extends UUIDColumn with PartitionKey
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
}
class BasicDatabase(override val connector: CassandraConnection) extends Database[BasicDatabase](connector) {
object entries extends active with Connector
}
implicit val keySpace: KeySpace = KeySpace("some_keyspace")
implicit val session: Session = db.session
object db extends BasicDatabase(CassandraConnector.default)
I'm still a newbie so any suggestions are useful, thanks in advance.
scala cassandra phantom-dsl
add a comment |
I'm using Phantom DSL (v2.28.0, scala v2.12.7) and upon each query to my database I receive the following ambiguous error:
scala.NotImplementedError: an implementation is missing
This doesn't happen when I use .future()
to resolve my query, in that case queries work just fine. Also, running a .executableQuery()
method returns a properly formatted query, which all points to my failure to build a model properly, but I don't get it what I'm doing wrong. Example queries:
Working queries:
db.entries.select.all.future // -> Returns a Future[ResultSet]
db.entries.select.where(_.user_id is userId).future() // -> ^
Failing queries:
db.entries.select.all.fetch // -> Err
db.entries.select.where(_.user_id is userId).fetch() // -> Err
db.entries.select.all.fetchRecord // -> Err
...
The same goes for paginateRecord() etc.
case class Rec(
id: UUID,
body: String,
time: DateTime,
user_id: Integer
)
abstract class active extends Table[active, Rec] {
object id extends UUIDColumn with PartitionKey
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
}
class BasicDatabase(override val connector: CassandraConnection) extends Database[BasicDatabase](connector) {
object entries extends active with Connector
}
implicit val keySpace: KeySpace = KeySpace("some_keyspace")
implicit val session: Session = db.session
object db extends BasicDatabase(CassandraConnector.default)
I'm still a newbie so any suggestions are useful, thanks in advance.
scala cassandra phantom-dsl
I'm using Phantom DSL (v2.28.0, scala v2.12.7) and upon each query to my database I receive the following ambiguous error:
scala.NotImplementedError: an implementation is missing
This doesn't happen when I use .future()
to resolve my query, in that case queries work just fine. Also, running a .executableQuery()
method returns a properly formatted query, which all points to my failure to build a model properly, but I don't get it what I'm doing wrong. Example queries:
Working queries:
db.entries.select.all.future // -> Returns a Future[ResultSet]
db.entries.select.where(_.user_id is userId).future() // -> ^
Failing queries:
db.entries.select.all.fetch // -> Err
db.entries.select.where(_.user_id is userId).fetch() // -> Err
db.entries.select.all.fetchRecord // -> Err
...
The same goes for paginateRecord() etc.
case class Rec(
id: UUID,
body: String,
time: DateTime,
user_id: Integer
)
abstract class active extends Table[active, Rec] {
object id extends UUIDColumn with PartitionKey
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
}
class BasicDatabase(override val connector: CassandraConnection) extends Database[BasicDatabase](connector) {
object entries extends active with Connector
}
implicit val keySpace: KeySpace = KeySpace("some_keyspace")
implicit val session: Session = db.session
object db extends BasicDatabase(CassandraConnector.default)
I'm still a newbie so any suggestions are useful, thanks in advance.
scala cassandra phantom-dsl
scala cassandra phantom-dsl
edited Nov 20 '18 at 21:03
Milan Velebit
asked Nov 20 '18 at 20:43
Milan VelebitMilan Velebit
7552619
7552619
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Alright, after digging into the source code, I figured out that the fromRow()
method of the abstract class was failing so I added an override:
abstract class active extends Table[active, Rec] {
object id extends TimeUUIDColumn
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
}
This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.
Last time I had this error, I had a type mismatch in my case class. Did you try changing theInteger
in your case class toInt
?
– Wizard
Dec 16 '18 at 17:55
@Wizard Yeah I did but to no avail
– Milan Velebit
Dec 16 '18 at 18:04
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53401210%2fphantom-dsl-scala-notimplementederror%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Alright, after digging into the source code, I figured out that the fromRow()
method of the abstract class was failing so I added an override:
abstract class active extends Table[active, Rec] {
object id extends TimeUUIDColumn
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
}
This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.
Last time I had this error, I had a type mismatch in my case class. Did you try changing theInteger
in your case class toInt
?
– Wizard
Dec 16 '18 at 17:55
@Wizard Yeah I did but to no avail
– Milan Velebit
Dec 16 '18 at 18:04
add a comment |
Alright, after digging into the source code, I figured out that the fromRow()
method of the abstract class was failing so I added an override:
abstract class active extends Table[active, Rec] {
object id extends TimeUUIDColumn
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
}
This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.
Last time I had this error, I had a type mismatch in my case class. Did you try changing theInteger
in your case class toInt
?
– Wizard
Dec 16 '18 at 17:55
@Wizard Yeah I did but to no avail
– Milan Velebit
Dec 16 '18 at 18:04
add a comment |
Alright, after digging into the source code, I figured out that the fromRow()
method of the abstract class was failing so I added an override:
abstract class active extends Table[active, Rec] {
object id extends TimeUUIDColumn
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
}
This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.
Alright, after digging into the source code, I figured out that the fromRow()
method of the abstract class was failing so I added an override:
abstract class active extends Table[active, Rec] {
object id extends TimeUUIDColumn
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
}
This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.
answered Nov 21 '18 at 21:35
Milan VelebitMilan Velebit
7552619
7552619
Last time I had this error, I had a type mismatch in my case class. Did you try changing theInteger
in your case class toInt
?
– Wizard
Dec 16 '18 at 17:55
@Wizard Yeah I did but to no avail
– Milan Velebit
Dec 16 '18 at 18:04
add a comment |
Last time I had this error, I had a type mismatch in my case class. Did you try changing theInteger
in your case class toInt
?
– Wizard
Dec 16 '18 at 17:55
@Wizard Yeah I did but to no avail
– Milan Velebit
Dec 16 '18 at 18:04
Last time I had this error, I had a type mismatch in my case class. Did you try changing the
Integer
in your case class to Int
?– Wizard
Dec 16 '18 at 17:55
Last time I had this error, I had a type mismatch in my case class. Did you try changing the
Integer
in your case class to Int
?– Wizard
Dec 16 '18 at 17:55
@Wizard Yeah I did but to no avail
– Milan Velebit
Dec 16 '18 at 18:04
@Wizard Yeah I did but to no avail
– Milan Velebit
Dec 16 '18 at 18:04
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53401210%2fphantom-dsl-scala-notimplementederror%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown