Class MySQLBatchFetcher fetches data from an app MySQL database using a query.
package |
PhpDruidIngest\Fetcher |
---|
fetch() : array|mixed
throws | |
---|---|
array|mixed
getMysqli( $host, $user, $pass, $db) : \mysqli
\mysqli
getOutput() : \Psr\Log\LoggerInterface
\Psr\Log\LoggerInterface
prepareQuery(String $query, String $start, String $end) : String
String
Query with {STARTDATE} and {ENDDATE} for value substituion
String
ISO Date Time string
String
ISO Date Time string
String
Prepared query string
processRow( $row) : mixed
mixed
setIntervals(string $intervalStart = "1970-01-01 01:30:00", string $intervalEnd = "3030-01-01 01:30:00")
string
string
setMySqlCredentials( $host, $user, $pass, $db)
setOutput(\Psr\Log\LoggerInterface $output)
\Psr\Log\LoggerInterface
setTimeWindow(string $start, string $end) : string
string
ISO DateTime for start of ingestion window
string
ISO DateTime for end of ingestion window
string
query : string
The parameters are inserted via string replacement: {STARTDATE} and {ENDDATE}
An example template: "SELECT id FROM things WHERE date BETWEEN '{STARTDATE}' AND '{ENDDATE}';"
var |
---|
string
host :
user :
pass :
db :
output : \Psr\Log\LoggerInterface
var |
---|
\Psr\Log\LoggerInterface