-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"name" returns null #1
Comments
yup there is a bug in the README thanks for alerting me to it. The output
variables must match the named fields in the struct.
so where you see
f.val = f.name.findName();
replace that with
f.name = f.name.findName();
I am in process of updating the accompanying medium post, but that example
does work.
https://medium.com/google-cloud/yet-another-way-to-generate-fake-datasets-in-bigquery-93ee87c1008f
CREATE TEMP FUNCTION entity()
RETURNS STRUCT<name String, phone String, ipv6 String, comp_name String>
LANGUAGE js
AS """
var f = getFaker()
var t = {};
t.name = f.name.findName();
t.phone = f.phone.phoneNumber('1-###-###-###')
t.ipv6 = f.internet.ipv6();
t.comp_name = f.company.companyName()
return t;
"""
OPTIONS (
library=["gs://<bucket>/bq_fake.js"]
);SELECT entity().*
…On Mon, Nov 16, 2020 at 5:04 PM Yannick Einsweiler ***@***.***> wrote:
I was just trying this to see how to adapt and generate fake company
names, but I don't get the sample code in the readme to work: ages get
generated but not names.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLHN6ZNSJBON2EQTYGIMA3SQGOVXANCNFSM4TXYEYBQ>
.
|
Thanks - on that note (updating medium post), what's your take on https://github.com/Marak/faker.js/issues/499#issuecomment-729087078 ? |
I'm definitely not a javascript expert. I thought the original project
uses gulp to separate out the dictionary files. It would be nice if the
npm libs were also shrunk down.
…On Thu, Nov 19, 2020 at 12:20 PM Yannick Einsweiler < ***@***.***> wrote:
Thanks - on that note (updating medium post), what's your take on Marak/faker.js#499
(comment)
<https://github.com/Marak/faker.js/issues/499#issuecomment-729087078> ?
I had noticed you used an earlier faker version probably so that it fits
within the 1MB limit as packaging a more recent release includes all
locales. Hacking the core lib is the only way I found to include some
locales only (updating index.js or deleting locales).
The require() statement in your index.ts only limits what gets loaded in
mem, not what goes in the webpack.
Thoughts ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLHN63ACB4SCKYRGYT3SZTSQVHW5ANCNFSM4TXYEYBQ>
.
|
Just noticed a "typo" in readme - in case someone uses it as-is:
this.val = f.name.findName();
should read
this.name = f.name.findName();
The text was updated successfully, but these errors were encountered: