Pyrophosphatase hydrolyzing the diphosphate bond in the nucleotide-sugars UDP-glucose and UDP-galactose with a preference for the former, yielding glucose 1-phosphate or galactose 1-phosphate and UMP. . This is the function of NUDT22 (nudix hydrolase 22, Ensembl gene identifier ENSG00000149761).