This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Trait to provide the $or method as a bareword operator. | |
* | |
* $or ("Foo" -> "bar") | |
* | |
* Targets an RValue of (String, Any)* to be converted to a DBObject | |
* | |
* TODO - Test that rvalue ends up being an array e.g.: | |
* | |
* scala> $or ("foo" -> "bar", "X" -> 5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* I'm trying to refactor $and and $or (which are essentially the same code returning a different outer query). | |
The problem is that currently only "String, Any" pairs work, and I need to be able to combine both those *AND* "Query Expression Objects". | |
Here's the $or spec right now | |
*/ | |
"Casbah's DSL $or Operator" should { | |
"Accept multiple values" in { | |
val or = $or("foo" -> "bar", "x" -> "y") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit def kvPairAsDBObject[A <: Any](kv: (String, A)): DBObject = MongoDBObject(kv) | |
sealed class NestedListOper(outerField: String) { | |
def apply[A <% DBObject](fields: A*): DBObject = { | |
val b = Seq.newBuilder[DBObject] | |
fields.foreach(x => b += x) | |
MongoDBObject(outerField -> b.result()) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait JodaDateTimePrimitive extends BSONDatePrimitive[DateTime] { | |
def rawValue(bson: Long): DateTime = { | |
new DateTime(bson) | |
} | |
def bsonValue(raw: DateTime): Long = { | |
raw.getMillis | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
import com.novus.salat._ | |
import com.novus.salat.global._ | |
import com.novus.salat.dao._ | |
import util._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[bamboo@bamboo-agent1 python2]$ ls | |
nosify.sh pip_me.sh r2.4.6 r2.5.6 r2.6.7 r2.7.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] /Users/brendan/code/mongodb/casbah/casbah-query/src/main/scala/Implicits.scala:151: not found: type scala | |
[error] @annotation.implicitNotFound("${A} is not a valid query parameter") | |
[error] ^ | |
[error] /Users/brendan/code/mongodb/casbah/casbah-query/src/main/scala/Implicits.scala:151: not found: type scala | |
[error] @annotation.implicitNotFound("${A} is not a valid query parameter") | |
[error] ^ | |
[error] one error found | |
[error] one error found | |
[error] {file:/Users/brendan/code/mongodb/casbah/}casbah-query/compile:doc: Scaladoc generation failed | |
[error] {file:/Users/brendan/code/mongodb/casbah/}casbah-query/compile:compile: Compilation failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val encoder = new com.mongodb.DefaultDBEncoder() | |
def encode(doc: DBObject): Long = { | |
encoder.synchronized { | |
val start = System.currentTimeMillis() | |
val encoded = encoder.encode(doc) | |
val end = System.currentTimeMillis() | |
end - start | |
} | |
} | |
DeregisterConversionHelpers() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? r | |
[info] Loading global plugins from /Users/brendan/.sbt/plugins | |
[info] Loading project definition from /Users/brendan/code/mongodb/mongo-hadoop/project | |
[info] Compiling 1 Scala source to /Users/brendan/code/mongodb/mongo-hadoop/project/target/scala-2.9.1/sbt-0.11.2/classes... | |
[error] Reference to undefined setting: | |
[error] | |
[error] {.}/*:hadoop-release from {.}/*:library-dependencies | |
[error] | |
[error] Use 'last' for the full log. | |
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE EXTERNAL TABLE scores ( student int, name string, score int ) | |
ROW FORMAT SERDE "com.mongodb.hadoop.hive.BSONSerde" | |
STORED AS INPUTFORMAT "com.mongodb.hadoop.hive.input.BSONFileInputFormat" | |
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' | |
LOCATION "/Users/brendan/code/mongodb/mongo-hadoop/hive/test"; | |
LOAD DATA LOCAL INPATH "scores.bson" INTO TABLE scores; |