-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode name compare.py
More file actions
48 lines (35 loc) · 1.28 KB
/
Node name compare.py
File metadata and controls
48 lines (35 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 6 14:53:38 2021
@author: xcxg109
"""
step_cat_name="""
, cat.CATEGORY_ID AS Category_ID
, cat.CATEGORY_NAME AS Category_Name
FROM PRD_DWH_VIEW_MTRL.CATEGORY_V AS cat
"""
ws_cat_name="""
WITH RECURSIVE tax AS (
SELECT id,
name,
ARRAY[]::INTEGER[] AS ancestors,
ARRAY[]::character varying[] AS ancestor_names
FROM taxonomy_category as category
WHERE "parentId" IS NULL
AND category.deleted = false
UNION ALL
SELECT category.id,
category.name,
tax.ancestors || tax.id,
tax.ancestor_names || tax.name
FROM taxonomy_category as category
INNER JOIN tax ON category."parentId" = tax.id
WHERE category.deleted = false
)
catID
node name
"""
pull step and gws node names and compare them
do they match?
false?
compare first __ number of characters - as a second check