Skip to content

Instantly share code, notes, and snippets.

View alibazlamit's full-sized avatar

Ali Bazlamit alibazlamit

View GitHub Profile

Create event JSON output

{
   "globally_mastered_persons":[
      {
         "EventInfo":{
            "Type":"Create",
            "SubmissionID":1,
            "PersonEventID":1
@alibazlamit
alibazlamit / franken_view_event_type.md
Created April 18, 2024 18:10
Franken view with event types

A person event record that result in a "new" event log

   {
      "cluster_id":1,
      "submission_id":1,
      "person_event_id":1,
      "tenant_id":1,
      "person_tenant_id":"",
      "person_universal_id":"",
package main
import (
"context"
"net/http"
"time"
"ib/mdm-admin/datamodel"
"ib/mdm-admin/redis"
CREATE MATERIALIZED VIEW merged_mastered_persons_log_mv
ON CLUSTER default
TO merged_mastered_persons_log
AS
WITH shared AS (
SELECT distinct
nm.*,
arrayJoin(arrayConcat([nm.new_tenant_id], dictGetOrDefault('data_sharing_policy_dict', 'tenant_id', nm.new_tenant_id, []))) as shared_tenant_id
FROM newly_mastered_persons AS nm
),
@alibazlamit
alibazlamit / gist:840788b57f6e9ee7cb270e6f888002a4
Created March 1, 2024 20:05
MV with address pre-aggregate
DROP VIEW if exists merged_mastered_persons_log_mv ON CLUSTER default;
CREATE MATERIALIZED VIEW merged_mastered_persons_log_mv
ON CLUSTER default
TO merged_mastered_persons_log
AS
WITH shared AS (
SELECT distinct
nm.*,
arrayJoin(arrayConcat([nm.new_tenant_id], dictGetOrDefault('data_sharing_policy_dict', 'tenant_id', nm.new_tenant_id, []))) as shared_tenant_id
@alibazlamit
alibazlamit / gist:c4f8a7487d7841aad47b6de43d08eb4b
Created February 23, 2024 22:17
example custom validdation
// Define a custom validation function to check if a field is equal to "test"
func isStringEqual(field reflect.Value) bool {
if field.Kind() == reflect.String {
return field.String() == "test"
}
return false
}
// Register the custom validation function with the validator
validator.RegisterCustomTypeFunc("isStringEqual", isStringEqual)
------------------------------------------------------------------------
Building jclouds OneAndOne REST api 2.2.0-SNAPSHOT
------------------------------------------------------------------------
--- maven-surefire-plugin:2.17:test (default-cli) @ oneandone ---
Surefire report directory: D:\Repos\oneandone\jclouds-labs\oneandone\target\surefire-reports
file.encoding cannot be set as system property, use <argLine>-Dfile.encoding=...<argLine> instead
-------------------------------------------------------
------------------------------------------------------------------------
Building jclouds OneAndOne REST api 2.1.0-SNAPSHOT
------------------------------------------------------------------------
--- maven-surefire-plugin:2.17:test (default-cli) @ oneandone ---
Surefire report directory: D:\Work2\OAO\jclouds-labs\oneandone\target\surefire-reports
file.encoding cannot be set as system property, use <argLine>-Dfile.encoding=...<argLine> instead
-------------------------------------------------------
T E S T S
@alibazlamit
alibazlamit / gist:28f3b5283b721bcd9a62c8f404622ac0
Created September 7, 2017 13:13
Building jclouds ProfitBricks REST api 2.1.0-SNAPSHOT
------------------------------------------------------------------------
Building jclouds ProfitBricks REST api 2.1.0-SNAPSHOT
------------------------------------------------------------------------
--- maven-surefire-plugin:2.17:test (default-cli) @ profitbricks-rest ---
Surefire report directory: D:\Work2\ProfitBricks\jclouds-labs\profitbricks-rest\target\surefire-reports
file.encoding cannot be set as system property, use <argLine>-Dfile.encoding=...<argLine> instead
-------------------------------------------------------
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./profitbricks/ -v -timeout 120m
=== RUN TestAccDataSourceDatacenter_matching
--- PASS: TestAccDataSourceDatacenter_matching (14.48s)
=== RUN TestAccDataSourceImage_basic
--- PASS: TestAccDataSourceImage_basic (9.13s)
=== RUN TestAccDataSourceLocation_basic
--- PASS: TestAccDataSourceLocation_basic (1.26s)
=== RUN TestAccResource_basic
--- PASS: TestAccResource_basic (15.31s)