Skip to content

Commit

Permalink
fix compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
LianxinGao committed Mar 31, 2021
1 parent d466aa3 commit 147ce21
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 25 deletions.
15 changes: 15 additions & 0 deletions kernel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@
<groupId>eu.medsea.mimeutil</groupId>
<artifactId>mime-util</artifactId>
<version>${mime-util.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>

</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
4 changes: 2 additions & 2 deletions kernel/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
</console>
</appenders>
<loggers>
<logger name="cn.pandadb" level="info"></logger>
<logger name="cn.pandadb" level="debug"></logger>
<logger name="org.grapheco.lynx.CypherRunner" level="debug"></logger>
<root level="all">
<root level="debug">
<appender-ref ref="Console"/>
</root>
</loggers>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cn.pandadb.kernel.kv.lynx.procedure
import cn.pandadb.kernel.kv.lynx.procedure.functions.{DateFunction, DateTimeFunction, ExistsFunction, ToIntegerFunction, TypeFunction}
import cn.pandadb.kernel.kv.lynx.procedure.functions.{DateFunction, DateTimeFunction, ExistsFunction, IdFunction, ToIntegerFunction, TypeFunction}
import org.grapheco.lynx.CallableProcedure

object PandaFunction {
Expand All @@ -8,7 +8,7 @@ object PandaFunction {
DateFunction,
DateTimeFunction,
TypeFunction,
// IdFunction,
IdFunction,
ExistsFunction
)
val lookup: Map[String, PandaFunction] = knownFunctions.map(f => (f.name.toLowerCase, f)).toMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ import cn.pandadb.kernel.store.{PandaNode, PandaRelationship}
import org.grapheco.lynx.{CallableProcedure, LynxBoolean, LynxInteger, LynxNode, LynxNull, LynxRelationship, LynxType, LynxValue}
import org.opencypher.v9_0.util.symbols.CTInteger

//case object IdFunction extends PandaFunction{
// override def name: String = ".id"
// val procedure = {
// Some(
// new CallableProcedure {
// override val inputs: Seq[(String, LynxType)] = Seq()
// override val outputs: Seq[(String, LynxType)] = Seq("id"->CTInteger)
//
//// override def call(args: Seq[LynxValue]): Iterable[Seq[LynxValue]] = {
//// Iterable(Seq(LynxInteger(args.head match {
//// case sNode: LynxNode => sNode.id.value.asInstanceOf[Long]
//// case sRel: LynxRelationship => sRel.id.value.asInstanceOf[Long]
//// })))
//// }
// }
// )
// }
// override def callableProcedure: Some[CallableProcedure] = {
// procedure
// }
//}
case object IdFunction extends PandaFunction{
override def name: String = ".id"
val procedure = {
Some(
new CallableProcedure {
override val inputs: Seq[(String, LynxType)] = Seq()
override val outputs: Seq[(String, LynxType)] = Seq("id"->CTInteger)

override def call(args: Seq[LynxValue]): Iterable[Seq[LynxValue]] = {
Iterable(Seq(LynxInteger(args.head match {
case sNode: LynxNode => sNode.id.value.asInstanceOf[Long]
case sRel: LynxRelationship => sRel.id.value.asInstanceOf[Long]
})))
}
}
)
}
override def callableProcedure: Some[CallableProcedure] = {
procedure
}
}

0 comments on commit 147ce21

Please sign in to comment.