Guidewire Best Practice UpD
Guidewire Best Practice UpD
For
From
Infometry Inc
39111 Paseo Padre Pkwy, Ste 218
Fremont, CA, 94538
www.infometry.net
Tel: (510) 793 5859
Change Record
The following table makes it easy to come back later and track what changes were made to the
requirements at each point of the project, who made them, and why they were made. This is a
way of implementing change control on the Functional Specification Document.
1. Introduction.............................................................................................................................................6
1.1. Document Purpose....................................................................................................................................6
2. References...............................................................................................................................................6
1.1. Glossary of Terms.......................................................................................................................................6
3. Snowflake Conventions............................................................................................................................7
1.2. Meta Data Table.........................................................................................................................................7
For Example:.........................................................................................................................................................7
Snowflake View...................................................................................................................................................12
Database Size......................................................................................................................................................18
Reference URL....................................................................................................................................................19
Parameter Setup.................................................................................................................................................20
For Example........................................................................................................................................................20
Recommendation.............................................................................................................................................27
Use dedicated Virtual Warehouses.....................................................................................................................27
SecurityAdmin....................................................................................................................................................28
Sysadmin.............................................................................................................................................................28
Public Role..........................................................................................................................................................29
Suggestion..........................................................................................................................................................29
Reference....................................................................................................................................................29
2. References
1.1. Glossary of Terms
3. Snowflake Conventions
For Example:
To know number of views and corresponding snowflake database schema
select * from EDW.AUDIT.sqlserver_object_info
where databasename ='EDW'
and schemaname='ORCL'
and object_type='VIEW'
IDW Stage
with b as (select * from edw.audit.sqlserver_table_info
where databasename = 'IDH_INTG'
and schemaname='JOBS')
select distinct a.table_schema,a.table_name,a.row_count
snowflake_count,b.numberofrecords sqlserver_count, a.row_count-b.numberofrecords
COMBINED.*
FROM
( SELECT
EMP_ADT.worker_AuditID As AuditID,
EMP_ADT.IntegrationID,
WINDOW.StartRecord as winstartrecordid,
WINDOW.EndRecord as winendrecordid
, REPLACE(EMP_ADT.FirstName, '''', '') as FirstName
, REPLACE(EMP_ADT.MiddleName, '''', '') as MiddleName
, REPLACE(EMP_ADT.LastName, '''', '') as LastName
, EMP_ADT.WorkerID as WorkerID
--, LOWER(RTRIM(EMP_ADT.WorkEmailName)) + '@guidewire.com' as LoginId
,(SELECT MAX(WorkEmailName)
FROM Stage.Worker_Audit
WHERE worker_AuditID < WINDOW.StartRecord
AND WorkerID = EMP_ADT.WorkerID
AND worker_AuditID IN (SELECT MAX(worker_AuditID)
FROM Stage.Worker_Audit
WHERE WorkerID = EMP_ADT.WorkerID
AND worker_AuditID < WINDOW.StartRecord
AND Concur_ProcessedFlag = 'P')) AS LoginId_Temp
, RTRIM(EMP_ADT.WorkEmailName) + '@guidewire.com' as EmailAddress
, CASE
WHEN EMP_ADT.RegionID = 'CH' and EMP_ADT.BusinessSiteID = 7 THEN 'CH'
ELSE BS.CountryCode
End as CtryCode
, CasE
WHEN BS.CountryCode = 'CA' THEN BS.CountryCode + '-' + BS.StateOrProvinceCode
ELSE NULL
END as CtrySubCode
Snowflake View
COMBINED.*
FROM
(SELECT
EMP_ADT.worker_AuditID As AuditID,
EMP_ADT.IntegrationID,
WINDOW.StartRecord as winstartrecordid,
WINDOW.EndRecord as winendrecordid
, REPLACE(EMP_ADT.FirstName, '''', '') as FirstName
, REPLACE(EMP_ADT.MiddleName, '''', '') as MiddleName
, REPLACE(EMP_ADT.LastName, '''', '') as LastName
, EMP_ADT.WorkerID as WorkerID
--, LOWER(RTRIM(EMP_ADT.WorkEmailName)) || '@guidewire.com' as LoginId
,(SELECT MAX(WorkEmailName)
FROM IDW.STAGE.Worker_Audit
WHERE worker_AuditID < WINDOW.StartRecord
AND WorkerID = EMP_ADT.WorkerID
AND worker_AuditID IN (SELECT MAX(worker_AuditID)
FROM IDW.STAGE.Worker_Audit
WHERE WorkerID = EMP_ADT.WorkerID
AND worker_AuditID < WINDOW.StartRecord
AND Concur_ProcessedFlag = 'P')) AS LoginId_Temp
/**
* Stored procedure to capture the error message in the procedure
* Note that this procedure is required the 6 different values
*This help to identify the procedure error
* PROCEDURENAME --> name of the procedure e.g. SP_ERROR_LOG
* SORUCESYEM --> name of the source system e.g. COUPA , ORACLE , SALESFORCE
* ERRORCODE, ERRORSTATE, ERRORMESSAGE, and ERRORTRACETEXT -- > system Generated
* Usage
* It is useful in Catch error
* CALL SP_ERROR_LOG('SPTEST','COUPA',err.code, err.state, err.message, err.stackTraceTxt)
* CALL SP_ERROR_LOG('SPTEST','COUPA','100183','P0000','SQL Complilation Error','At
Statement')
*/
var result =''
//Captures the procedure error log into the EDW.AUDIT.SP_ERROR_LOG table -- 13 July 2020
// Removed the schema name and database name as defined in default values
var v_sql_command = `insert into EDW.AUDIT.SP_ERROR_LOG(
PROCEDURENAME,
SOURCE_SYSTEM,
ERROR_CODE,
ERROR_STATE,
ERROR_MESSAGE,
STACK_TRACE) VALUES (:1,:2,:3,:4,:5,:6);`;
var v_rs = snowflake.createStatement({sqlText: v_sql_command,
$$
;
union
union
Database Size
use Empire;
sp_helpdb Empire;
sp_spaceused ;
Reference URL
SQL SERVER- OBJECT DEPENDENCIES
The metadata objects information
METADATA_OBJECTS
Task Scheduling
Parameter Setup
The Above link to check the same queue type scenario to update the parameter instead of
default .
For Example
ALTER WAREHOUSE s_WH_IDW SET STATEMENT_QUEUED_TIMEOUT_IN_SECONDS =120
STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = 60 seconds or 120 seconds instead of 0 to
clear the queue
HANDLING_JDBC_DRIVER
<ApPayments>
<TransactionId>202006221400123524</TransactionId>
<ApPayment>
<PAYMENT_ID>969245</PAYMENT_ID>
<PaymentKey>81636</PaymentKey>
<VendorId>E-100333</VendorId>
<TotalAmount>30.7</TotalAmount>
<PaymentDate>2020-06-22T00:00:00.000+00:00</PaymentDate>
<PaymentMethod>EFT</PaymentMethod>
<TransactionState>NEGOTIABLE</TransactionState>
<Currency>EUR</Currency>
<LineItems>
<PAYMENT_ID>969245</PAYMENT_ID>
<LineItem>
<BillNo>FF-a1t2T000004OfMYQA0-101526</BillNo>
<LineItemKey>2753089</LineItemKey>
<TransactionAmount>30.7</TransactionAmount>
<SourceSystem>FF</SourceSystem>
</LineItem>
</LineItems>
</ApPayment>
Microsoft Excel
Worksheet
Recommendation
Use always Upper in both sides for validations in query
o For tables that have the large Data warehouse cluster keys to improve query
performance
For very large tables ( multi-terabyte size ) , Cluster keys which are frequency
used in WHERE clauses or are frequently used in JOINS or ORDER BY statements
SecurityAdmin
Sysadmin
Maintain Role Hierarchy and custom role directly and indirectly given to Sysadmin
Other the sysadmin role will not able to administer all the objects
If you explicitly want to limit privilege to only the owning user then do not assign to Sysadmin
Public Role
Suggestion
Developer account needs to have the privilege of create or drop table such as temporary table
Reference
-- As a convenience, this grabs the last SQL run so that it's easier to insert into the parameter used to
call the stored procedure.
set query_text = (select 'INSERT INTO sqlserver_table_audit
select databasename, schemaname, tablename,numberofrecords,
snf_databasename, snf_schemaname,insert_date,null status ,current_timestamp() modify_date
from sqlserver_check');
-- Confirm that the query_text variable has the correct SQL query to generate our SQL commands
(grants in this case) to run.
select $query_text as QUERY_TEXT;
--Run the stored procedure. Note that to view its output better, double click on the output to see
it in multi-line format,
Call RunBatchSQL($query_text, true);
select QUERY_TEXT
from table(information_schema.query_history(result_limit => 2))
where SESSION_ID = Current_Session() and QUERY_TYPE = 'SELECT' order by
START_TIME desc
call RunBatchSQL();
SHOW FUTURE GRANTS IN DATABASE EDL;
Please Click below URL and Register Snowflake Lodge Login.. It is free and get more information
insight of Snowflake.
Step 3 : Below Left side topic , Go through each topic if you have time
Microsoft Excel
Worksheet
2. Float data-type issue is a known issue. We can't be sure about the number of digits to the right of the
decimal point
While Comparing Data between SQL and SNOWFLAKE there was lot of mismatches due to Data types.
Source table has more no of rows Compare to Target table.
Rows count were mismatching in Snowflake.
Parallel Run Decision.
Change in datatype.
Object verification.
Verifying views and check the rows.
Checking minimum and maximum of column value.
Check sum of columns value.
Checking data sets
Migration of values depending on other fields/tables present in the source database.
Data in the source table may be present as a character, but in the target table the mapped column is an
integer.
Concatenation of two or more columns.
There were some structure changes between the source and target database tables which increased the
testing challenge. For example, the source table columns were directly mapped to the primary keys from
master tables with common data types such as varchar or int whereas in the target database, along with
common data types, they also had auto generated GUIDs for each row of table.
Microsoft Excel
Worksheet
Testing Strategy
Risks
Frequent interaction and design sessions are required with Guidewire team to understand the
IDW process logic
Avoid table/schema/column name changes so that ETL procedures need not have to re-written