2018-01-01ãã1å¹´éã®è¨äºä¸è¦§
MySQLã§ãã«æå(NUL)ãªã©ã®å¶å¾¡æåãå«ã¾ãã¦ããæååãæ¢ãæ¹æ³ã®ã¡ã¢
ãã«æå(NUL) ã®å¤å® MySQLã§ã¯nullæå㯠'\0' ã CHAR(0) ã§è¡¨ãã¾ããªã®ã§ ãã«æåãå«ãæåå㯠æåå LIKE '%\0%' ã®ãããªæãã§å¤å®ã§ãã¾ã(ä»ã®æååç³»ã®é¢æ°ã§ãããã¯ã) mysql> SELECT CHAR(0) LIKE '%\0%'; +---------------------+ | CHAâ¦
BigQueryã§ã¯STRUCT(æ§é ä½)åãARRAY(é å)åã使ãã¾ã ãã¼ã¿å | BigQuery | Google CloudSTRUCTåã®ã«ã©ã ã§GROUP BYãããã¨ããã¨Grouping by expressions of type STRUCT is not allowed atã®ãããªã¨ã©ã¼ãåºã¦ãã¦å®è¡ãããã¨ãã§ãã¾ãã åæ§ã«â¦
BigQueryã«BigQuery MLã¨ããæ©æ¢°å¦ç¿ã®æ©è½ã追å ããã¾ãããä»ã¯ãã¸ã¹ãã£ãã¯å帰ã«ããåé¡ã¨ç·å½¢å帰ã«ããå帰åé¡ã«ã¤ãã¦å¦ç¿ãã§ããããã§ãå¦ç¿æã«å¤æ°ã«å¯¾ãã¦ã©ã®ãããªåå¦çãè¡ãããã®ãæ°ã«ãªã£ãã®ã§èª¿ã¹ã¦ã¿ã¾ãã 誤ããªã©ããã£ãâ¦
PythonãRubyã ã¨[1, 2] * 3ã¨æ¸ãã¨[1, 2]ã3åç¹°ãè¿ããé å[1, 2, 1, 2, 1, 2]ãå¾ããã¾ã ãããPHPã§ç°¡åã«æ¸ãæ¹æ³ããªããèãã¦ã¿ã¾ãã äºéã®forã«ã¼ãã§é åã«è¶³ãã¦ããæ¹æ³ æåã«èªæãªæ¹æ³ã®äºéã®forã«ã¼ãã§è¶³ãã¦ããæ¹æ³ãæ¸ãã¦ããã¾â¦
æ´æ°(INT64å)ãæµ®åå°æ°ç¹æ°(FLOAT64å)ãBYTESåã«ãããã£ãã®ã§èªåã§å¦çãUDFã¨ãã¦æ¸ãã¾ãã BigQueryã®CASTé¢æ°ã§BYTESåã«ãã£ã¹ãã§ã§ããã®ã¯BYTESåèªèº«ã¨STRINGåã«éããã¦ããã®ã§ãä»ã®åãå¤æãããã¨ãã«ã¯èªåã§å¦çãæ¸ãå¿ è¦ãããã¾â¦
BigQueryã®ã¯ã¨ãªã§ãã¼ãã«åã®æ«å°¾ã«æ¥ä»ãªã©ãå ¥ãã¦ãã㦠_TABLE_SUFFIX ã®ã«ã©ã ã®æ¡ä»¶ã§å©ç¨ãããã¼ãã«ãçµãè¾¼ã¿ããæã«ã_TABLE_SUFFIXã®æ¡ä»¶ããã¥ã¼ãWITHå¥ã®å¤å´ããæ¸ãã¦ã¿ã話ã§ã
æ®å¿µãªãã¨ã«DBã«JSONãªã©ã§ã¯ãªãPHPã§ã·ãªã¢ã©ã¤ãºãããå½¢å¼ã§ãã¼ã¿ãä¿åããã¦ãããã¨ãããã¾ã ãã®ä¸èº«ãBigQueryå´ããåç §ãããã£ãã®ã§èª¿ã¹ã¦ã¿ã¾ãã軽ãæ¤ç´¢ããã¨ããJavaScriptã§PHPã®ã·ãªã¢ã©ã¤ãºããããã¼ã¿ããã¨ã«æ»ããã©ã¤ãã©ãªã¯â¦
ç´ æ°åæ 以åæ¸ããè¨äºã§ã¯\(10^4\)ãããã®ãªã¼ãã¼ã¾ã§ããç´ æ°ãåæã§ãã¾ããã§ããããã¯ã¨ãªã工夫ãã¦\(10^7\)ãããã¾ã§ã¯è¡ããããã«ãªãã¾ãã sucrose.hatenablog.com 以åã®ã¯ã¨ãª ä¸ã®è¨äºã«æ¸ãã試ãå²ãã«ãã\(10^4\)åãããã¾ã§ãéâ¦
GENERATE_ARRAY(start_expression, end_expression[, step_expression])é¢æ°ã使ãã¨é£çªã®æ°å¤(çå·®æ°å)ãä½ããã¨ãã§ãã¾ã ãªãã¡ã¬ã³ã¹ ãããä¸åº¦ã«ä½ãåæ°ãå¤ãã¨Error: GENERATE_ARRAY(1, 10000000, 1) produced too many elementsã®ããã«ã¨ã©ã¼â¦
ç¯å²ãé¸æãã¦Ctrl + /ãæ¼ãã°ããã¿ããã§ã(Macã®å ´åã¯â Cmd + /) BigQueryã®ãã¼ãã¼ãã·ã§ã¼ãã«ãã 以ä¸ã®ç¯å²é¸æããç¶æ ã§Ctrl + /ãæ¼ã㨠æåãæ¸ããã¦ããé¨åã ãã³ã¡ã³ãã¢ã¦ãããã¾ã éã«ãã®å½¢å¼(å é ã«-- )ã§ã³ã¡ã³ãã¢ã¦ãããã¦ãâ¦
以åBigQueryã§é åãzipããè¨äºãæ¸ãã¾ãã ãããã使ã£ã¦é åã«æ·»åããã£ã¤ãããã¨ãã§ãããçãªãã¨ãæ¸ãã¦ããã®ã§ãããæ·»åãå¾ãã ããªãWITH OFFSETã¨æ¸ãã ãã§ãããã¨ã«æ°ã¥ããã®ã§ã¡ã¢ãã¦ããã¾ã sucrose.hatenablog.comä¸ã®è¨äºã§ã¯Uâ¦
以åJShellã§ã¯ã³ã©ã¤ãã¼ã®ã¹ã¯ãªããã£ã½ãæ¸ãã®ã«ææ¦ãã¾ãã sucrose.hatenablog.com ãã®è¨äºãæ¸ãã¦ããJavaã§ã¯ã³ã©ã¤ãã¼ãæ¸ãã¦ä»ã®è¨èªãããå¬ããå ´åã£ã¦ããã¾ããªãããã¨æãå§ãã¦ãã¾ããã¨ããããæãã¤ããä¾ã¨ãã¦ãJavaã®Robotã¯â¦
Java9ããJShellã¨ããREPL(対話åã®å®è¡ç°å¢)ã使ããããã«ãªãã¾ãã mainé¢æ°ãªã©ãæ¸ããã¨ãã³ã¼ãçãå ¥åããã°ãã®å®è¡çµæã試ããã¨ãã§ãã¾ã対話形å¼ä»¥å¤ã«ããã¡ã¤ã«ãããã¯æ¨æºå ¥åã§ã³ã¼ãã渡ãã¨å®è¡ãã¦ãããã®ã§ãç°¡åãªã¯ã³ã©ã¤ãã¼â¦
æè¿æ¸ããå帰ã使ã£ãæ£è¦è¡¨ç¾ãå¯è¦åãããã¨æã£ã¦Googleæ¤ç´¢ãã¦ã¿ãã®ã§ãããä¸ä½ã«åºã¦ãããµã¤ãã§ãæ¥æ¬èªã使ããªãã£ãããµãã¼ããã¦ããæ£è¦è¡¨ç¾ã«PCREã®ç¯å²(ã¨ãããå帰)ãå«ã¾ãã¦ããªãã£ããããããã§ãã ããã¤ãæ£è¦è¡¨ç¾ã®å¯è¦åãµâ¦
MySQL 5.7ããã¯JSONåã®ã«ã©ã ã使ããããã«ãªãã¾ãããã®JSONåã«ã¯MySQLã®ããããNULLå¤ã¨ã¯å¥ã«å¤ããªããã¨ã示ãnullã¨ããå¤ããã£ã¦æ··ä¹±ããã®ã§ã¡ã¢ãã¦ããã¾ã (ãã®è¨äºã®å 容ã¯ãã¾ãã¾æå ã«ãã£ãMySQL 5.7.20ã§ç¢ºããã¾ãã)便å®ä¸ãã®è¨â¦
PerlãPHPãªã©ã®æ¨æºã®æ£è¦è¡¨ç¾ã©ã¤ãã©ãªã¯ãã¿ã¼ã³ã®å帰ããµãã¼ããã¦ãã¾ã(ã©ãã¾ã§ãæ£è¦è¡¨ç¾ã¨ãããã¯ã¨ãããã¨ãã¦)以ä¸ã®è¨äºã®FizzBuzzã解ã話ã§ä½¿ã£ã3ã®åæ°ã表ãæ£è¦è¡¨ç¾ãå帰ã使ãã°ã¹ãããªæ¸ãããã ã£ãã®ã§è©¦ãã¦ã¿ã¾ããæ£è¦è¡¨ç¾â¦
FizzBuzzãæ£è¦è¡¨ç¾ã§è§£ããããªã£ãã®ã§è§£ãã ç¥ã£ã¦ã人ãå¤ãã¨æãã¾ãã念ã®ããåé¡ã®å 容ã説æãã¦ããã¨ãå ¥åãããæ´æ°ã3ã®åæ°ã®ã¨ãã¯Fizzã5ã®åæ°ã®ã¨ãã¯Buzzã15ã®åæ°ã®ã¨ãã¯FizzBuzzããã®ä»ã®ã¨ãã¯æ°å¤ããã®ã¾ã¾åºåãã¾ã Fizz Buâ¦
åã«AtCoderã®ã¬ã¼ãã£ã³ã°ã®åå¸ã«ã¤ãã¦èª¿ã¹ã¦è¨äºãæ¸ãã¾ãã sucrose.hatenablog.com Twitterã§ãAtCoderã«ããããåå ããã°ã¬ã¼ãã£ã³ã°ãä¸ãããã¨ãã話ãè¦ããã¦æ°ã«ãªã£ãã®ã§ãã¦ã¼ã¶ã¼ã®åå åæ°ã¨ã¬ã¼ãã£ã³ã°ã®é¢ä¿ãéã«ã°ã©ãã«ãããã¬â¦