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
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:batch="http://www.springframework.org/schema/batch" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd | |
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd"> | |
<bean id="processInfo" class="com.cloudcruiser.batch.ProcessInfo"> | |
<property name="processName" value="EndStateUsageAndCharge" /> | |
<property name="usageTimeZone" value="Europe/London" /> | |
</bean> |
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
<?xml version="1.0" encoding="UTF-8"?><procedure description="Zeros out usage measures except for last record of month per resource" name="sp_end_state_usage"> | |
<sqlserver> | |
<![CDATA[ | |
DELIMITER GO | |
CREATE PROCEDURE $CCATTRIBUTE(name) | |
@inSelectDate NCHAR(8) | |
AS |
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
DELIMITER GO | |
CREATE PROCEDURE $CCATTRIBUTE(name) | |
@inSelectDate NCHAR(8) | |
AS | |
BEGIN | |
DECLARE @vStartDate BIGINT; | |
DECLARE @vEndDate BIGINT; | |
SET @vStartDate = dbo.cc_date_to_seconds(DATEADD(MONTH, DATEDIFF(MONTH, 0, CAST(@inSelectDate + N' 00:00:00' AS datetime)), 0)); |
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
view: outlays { | |
derived_table: { | |
sql: | |
SELECT | |
account_name, | |
agency_name, | |
bureau_name, | |
subfunction_title, | |
treasury_agency_code, | |
CAST(REPLACE(outlays.TQ, ",", "") AS INT64) AS tq, |
Loading
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
import logging | |
from google.cloud import bigquery | |
SERVICE_ACCOUNT = '/path/to/credentials/file/<role>-<project>.json' | |
BQ_DATASET = 'state_data' | |
client = bigquery.Client.from_service_account_json(SERVICE_ACCOUNT) | |
dataset = BQ_DATASET | |
logger = logging.getLogger() |
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
import json | |
import avro.schema | |
from avro.datafile import DataFileWriter | |
from avro.io import DatumWriter | |
STATE_SCHEMA = 'state_schema.avsc' | |
STATE_RECORDS = 'state_records.avro' | |
model_dictionary = { | |
'dimensions': set(), |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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
-- old: Location to save backup | |
-- db_name: Name of the SQL Server Database | |
-- app_admin: Username of the administration login | |
-- default_password: Default password for a new administration login | |
-- BACKUP DATABASE TO DEFAULT LOCATION - NOTE: Filename currently hardcoded | |
BACKUP DATABASE [{{ db_name }}] TO DISK = '{{ old }}' WITH NOFORMAT, NOINIT, NAME = N'{{ db_name }}-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 | |
GO |
NewerOlder