Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
message spark_schema { | |
optional binary id (UTF8); | |
optional group meta { | |
optional binary id (UTF8); | |
optional binary versionId (UTF8); | |
optional int96 lastUpdated; | |
optional group profile (LIST) { | |
repeated group list { | |
optional binary element (UTF8); | |
} |
This file contains 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
Running org.kitesdk.data.spi.filesystem.TestFileSystemView | |
Tests run: 34, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 1.989 sec | |
Running org.kitesdk.data.spi.filesystem.TestHDFSDatasetURIs | |
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.128 sec | |
Running org.kitesdk.data.spi.filesystem.TestInputFormatKeyReader | |
Tests run: 5, Failures: 1, Errors: 4, Skipped: 0, Time elapsed: 0.073 sec <<< FAILURE! | |
testBasicBehavior(org.kitesdk.data.spi.filesystem.TestInputFormatKeyReader) Time elapsed: 0.034 sec <<< ERROR! | |
org.kitesdk.data.DatasetIOException: Cannot calculate splits | |
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) | |
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744) |
This file contains 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
user=> (require '[clara.rules :refer :all]) | |
nil | |
user=> (defrecord Person [first last]) | |
user.Person | |
user=> (defrule say-hello [Person (= ?first-name first)] => (println "Hello," ?first-name)) | |
#'user/say-hello | |
user=> (-> (mk-session :cache false) (insert (->Person "Jane" "Doe")) (fire-rules)) | |
Hello, Jane | |
#<LocalSession clara.rules.engine.LocalSession@42d33bc1> | |
user=> |
This file contains 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
(ns clara.rules.changelog | |
"Support for extracting and replaying a sequence of changes. The extract sequence represents the logical difference | |
between the state of the given session and a previous point in time, but does not reflect every intermediate step | |
along the way. For instance, if a given fact is inserted and retracted a million times prior to getting the change | |
sequence, that sequence will contain no entries reflecting that fact. This is done to prevent unbounded growth of | |
the log. | |
Each item in the change sequence is one of three structures, with schemas defined below. They are: | |
* Fact Change -- an arbitrary Clojure structure in the working memory -- and the number of instances in the memory. |
This file contains 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
(defrule date-too-early | |
"We can't schedule something too early." | |
[WorkOrder (< (weeks-until date) 2)] | |
=> | |
(insert! (->ApprovalRequired :timeline "Date is too early"))) | |
(pprint date-too-early) |
This file contains 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
(ns playground.recursive | |
(:require [schema.core :as s] | |
[schema.macros :as macros] | |
[schema.utils :as utils]) | |
(:import [schema.core Schema])) | |
;; A schema implementation that simply delegates to the schema | |
;; in the given var, allowing fo recursion. | |
(defrecord Recursive [schema-var] | |
Schema |
This file contains 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
(defrule reduce-device-speed | |
"Reduce the speed of all devices in a location that has a high temperature." | |
[CurrentTemperature (> value high-threshold) | |
(= ?location-id location)] | |
;; Find all Device records in the location, and bind them to the ?device variable. | |
[?device <- Device (= ?location-id location)] | |
=> | |
(reduce-speed! ?device)) |
This file contains 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
(defrule reduce-device-speed | |
"Reduce the speed of all devices in a location that has a high temperature." | |
[CurrentTemperature (> value high-threshold) | |
(= ?location-id location)] | |
;; Find all Device records in the location, and bind them to the ?device variable. | |
[?device <- Device (= ?location-id location)] | |
=> | |
(reduce-speed! ?device)) |