並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 30 件 / 30件

新着順 人気順

insert null value sql pythonの検索結果1 - 30 件 / 30件

  • 文春オンラインの記事分析を支える爆速ダッシュボードを作るまで|田島将太 | TAJIMA Shota

    従来のGoogleアナリティクスである、ユニバーサル アナリティクス(以下UA)のサポートがいよいよ2023年7月に終了することが、先日アナウンスされました(※)。昨年対比やトレンドをチェックすることを考えると、2022年内できるだけ早めに次世代のGoogleアナリティクス(以下GA4)へ移行したいWebメディア運営者も多いかと思います。新しいツールの勉強や、既存システムの改修が必要な問題ではありますが、この機会を、データ収集・可視化の設計を見直し、日々の意思決定の共通言語としてデータを使いやすくするチャンスと捉えてみてはいかがでしょうか。 ※  Google、ユニバーサルアナリティクスのサポートを2023年7月1日に終了。早めのGA4移行を推奨 このnoteでは、前半でダッシュボードによるデータの可視化にコストをかけるべき理由を整理します。後半では、2021年秋に文春オンラインのダッシュ

      文春オンラインの記事分析を支える爆速ダッシュボードを作るまで|田島将太 | TAJIMA Shota
    • Bulk insertでも20時間以上かかっていたMySQLへのインサート処理を1時間以内にする - エムスリーテックブログ

      この記事はエムスリー Advent Calendar 2022の30日目の記事です。 前日は id:kijuky による チームメンバーのGoogleカレンダーの休暇予定一覧をスプレッドシート+GASで作った でした。 AI・機械学習チームの北川(@kitagry)です。 今回はMySQLへのインサートを20倍以上高速化した話について書きます。 仕事をちゃんとしてるか見張る猫 TL; DR はじめに 今回のテーブル バイナリログを無効化する 追試 LOAD DATA INFILE 追試 テーブルの正規化 インデックスを一時的に剥がす まとめ We are hiring!! TL; DR バイナリログをオフにする LOAD DATA INFILEを使う インデックスを一時的に消す はじめに AI・機械学習チームではサイトトップからアプリに至るまで多くの推薦システムがあります。 そこでは推薦ロ

        Bulk insertでも20時間以上かかっていたMySQLへのインサート処理を1時間以内にする - エムスリーテックブログ
      • 関数名、メソッド名、変数名でよく使う英単語のまとめ

        プログラミングをしていると関数名、メソッド名、変数名をどうするか悩みます。 ロジックより命名に時間を費やすこともざらにあります。翻訳したり、一般的な命名規則なのかいつも検索して大変です。 よく使うサイトの内容をコピってメモしておく 関数名とメソッド名の違いについて よく使う英単語のまえに、いつもごっちゃにして使っているけど、定義はこんな感じ 「関数」と「メソッド」の違い 似ているところ どちらも何か(引数)を入れると処理をして何か(戻り値)を返してくれます。 違うところ やってること自体は大差ありません。概念としては違います。 メソッドはオブジェクト指向で登場する用語で、オブジェクトの動作を定義したものです。 まずオブジェクトありきなのですね。一方の関数は、オブジェクト云々は関係ありません。 個人的な使い分け Java で登場する関数は「メソッド」です。C 言語で登場する関数は「関数」と呼

          関数名、メソッド名、変数名でよく使う英単語のまとめ
        • Deno入門 ─ 新しいTypeScript/JavaScript実行環境でWebアプリ開発とデータベース接続の基本を体験しよう|ハイクラス転職・求人情報サイト アンビ(AMBI)

          例えばmain.tsというスクリプトに対して、ファイルの読み取りだけを許可したい場合は、以下のようにコマンドを実行します。 $ deno run --allow-read main.ts このときmain.tsプログラムはファイルの読み取りだけが可能になるため、ファイルの書き込みやネットワークアクセスをするとPermissionErrorによる実行時エラーになります。 なお、実行時にフラグを何も与えなければ、どの権限も持っていない状態になります。 各フラグにはパラメータを指定でき、例えば次のように実行すると/home/userディレクトリの読み込みだけが許可されます(--allow-writeフラグも同様)。 $ deno run --allow-read=/home/user main.ts また、--allow-netを次のように指定すると、特定のドメインとポートだけのアクセスを許可で

            Deno入門 ─ 新しいTypeScript/JavaScript実行環境でWebアプリ開発とデータベース接続の基本を体験しよう|ハイクラス転職・求人情報サイト アンビ(AMBI)
          • Apache Iceberg とは何か - Bering Note – formerly 流沙河鎮

            はじめに 概要 Apache Iceberg(アイスバーグ)とは [重要] Icebergの本質はテーブル仕様である Table Spec バージョン Icebergハンズオン Icebergの特徴 同時書き込み時の整合性担保 読み取り一貫性、Time Travelクエリ、Rollback Schema Evolution Hidden Partitioning Hidden Partitioningの種類 時間 truncate[W] bucket[N] Partition Evolution Sort Order Evolution クエリ性能の最適化 ユースケース Icebergのアーキテクチャ Iceberg Catalog Iceberg Catalogの選択肢 metadata layer metadata files manifest lists manifest files

              Apache Iceberg とは何か - Bering Note – formerly 流沙河鎮
            • PostgreSQL Client から自作 DBMS に接続する - goropikariの備忘録

              最近、Go の練習がてら書いていた自作 DBMS に PostgreSQL client で接続できるようになったので、そのやり方を残しておきます。(これから紹介するサンプルコードはすべて Python ですが) github.com psql --version psql (PostgreSQL) 13.2 pgcon の資料と PostgreSQL の公式 Document、加えて PostgreSQL server と client 間に流れるパケットを眺めると、自作DBMSは client から接続されたときにどういうパケットを返せばいいのかが見えてきます。 https://www.pgcon.org/2014/schedule/attachments/330_postgres-for-the-wire.pdf https://www.postgresql.org/docs/13/

                PostgreSQL Client から自作 DBMS に接続する - goropikariの備忘録
              • dbt (data build tool) を使ってデータをテストする - CUBE SUGAR CONTAINER

                ソフトウェアエンジニアリングの世界では、自動化されたテストを使ってコードの振る舞いを検証するのが当たり前になっている。 同じように、データエンジニアリングの世界でも、自動化されたテストを使ってデータの振る舞いを検証するのが望ましい。 データをテストするのに使える OSS のフレームワークも、いくつか存在する。 今回は、その中でも dbt (data build tool) を使ってデータをテストする方法について見ていく。 dbt 自体はデータのテストを主目的としたツールではないものの、テストに関する機能も備えている。 また、dbt には WebUI を備えたマネージドサービスとしての dbt Cloud と、CLI で操作するスタンドアロン版の dbt Core がある。 今回扱うのは後者の dbt Core になる。 使った環境は次のとおり。 $ sw_vers ProductName:

                  dbt (data build tool) を使ってデータをテストする - CUBE SUGAR CONTAINER
                • Weird Lexical Syntax

                  I just learned 42 programming languages this month to build a new syntax highlighter for llamafile. I feel like I'm up to my eyeballs in programming languages right now. Now that it's halloween, I thought I'd share some of the spookiest most surprising syntax I've seen. The languages I decided to support are Ada, Assembly, BASIC, C, C#, C++, COBOL, CSS, D, FORTH, FORTRAN, Go, Haskell, HTML, Java,

                    Weird Lexical Syntax
                  • しくじり先生のように学ぶ「NFS+sqliteで苦労した話から学ぶ、問題解決の考え方」という勉強会をやってみました | Raccoon Tech Blog [株式会社ラクーンホールディングス 技術戦略部ブログ]

                    株式会社ラクーンホールディングスのエンジニア/デザイナーから技術情報をはじめ、世の中のためになることや社内のことなどを発信してます。 インフラLinux勉強会SQLiteNFS こんにちは、羽山です。 今回は社内で実施した勉強会をほぼそのままブログ記事にしています。 ITエンジニアたるものドキュメントを残したり勉強会を実施したり分かりやすい設計にリファクタリングしたりなど、日々 知見の伝達 を意識していると思います。主要な知見はたいていそれらの方法で満たせるのですが、しかし残念ながら中には画一的な方法では伝えにくいものもあったりします。 ところで伝統芸能や工芸の世界では技術の継承において 背中を見て学ぶ という方法が用いられることがあるようです。 これと似た手法はITエンジニアの世界にもあって、先輩エンジニアとペアプログラミングをすることで文書では伝わりにくい技術や考え方・テクニックを学ぶ

                      しくじり先生のように学ぶ「NFS+sqliteで苦労した話から学ぶ、問題解決の考え方」という勉強会をやってみました | Raccoon Tech Blog [株式会社ラクーンホールディングス 技術戦略部ブログ]
                    • So You Want To Remove The GVL?

                      I want to write a post about Pitchfork, explaining where it comes from, why it is like it is, and how I see its future. But before I can get to that, I think I need to share my mental model on a few things, in this case, Ruby’s GVL. For quite a long time, it has been said that Rails applications are mostly IO-bound, hence Ruby’s GVL isn’t that big of a deal and that has influenced the design of so

                      • Spring Boot and Cloud Native Buildpacks Hands-on Lab

                        以下のソフトウェアをインストールしてください。 Java 11 docker pack curl jq この資料は次のバージョンで動作確認しています。 $ java -version openjdk version "11.0.10" 2021-01-19 LTS OpenJDK Runtime Environment (build 11.0.10+9-LTS) OpenJDK 64-Bit Server VM (build 11.0.10+9-LTS, mixed mode) $ docker version Client: Docker Engine - Community Cloud integration: 1.0.9 Version: 20.10.5 API version: 1.41 Go version: go1.13.15 Git commit: 55c4c88 Built

                        • Python: Just write SQL

                          I have been writing a lot more Go this past year. For those not familiar, Go favours a non-ORM, non-query-builder approach to interacting with databases. This comes naturally due to the sql package: A common interface to be used alongside database drivers. It’s very common to see actual SQL in Go, even in large projects. On the other hand, Python does not have anything in the standard library that

                          • prompts.chat

                            Welcome to the “Awesome ChatGPT Prompts” repository! While this collection was originally created for ChatGPT, these prompts work great with other AI models like Claude, Gemini, Hugging Face Chat, Llama, Mistral, and more. ChatGPT is a web interface created by OpenAI that provides access to their GPT (Generative Pre-trained Transformer) language models. The underlying models, like GPT-4o and GPT-o

                            • Announcing DuckDB 1.3.0

                              To install the new version, please visit the installation guide. Note that it can take a few hours to days to release some client libraries (e.g., Go, R, Java) and extensions (e.g., the UI) due to the extra changes and review rounds required. We are proud to release DuckDB 1.3.0. This release of DuckDB is named “Ossivalis” after Bucephala Ossivalis, an ancestor of the Goldeneye duck that lived mil

                                Announcing DuckDB 1.3.0
                              • What's New in Emacs 28.1?

                                Try Mastering Emacs for free! Are you struggling with the basics? Have you mastered movement and editing yet? When you have read Mastering Emacs you will understand Emacs. It’s that time again: there’s a new major version of Emacs and, with it, a treasure trove of new features and changes. Notable features include the formal inclusion of native compilation, a technique that will greatly speed up y

                                • GA4のテーブルをBigQueryからPostgreSQLにAvroファイル経由でコピーする - Qiita

                                  設定ファイルはPythonコードを動かすディレクトリに置きます。 設定ファイルの[BigQuery]セクションに、GA4のテーブルが入っているGoogle Cloudのプロジェクト名とデータセット名を記述します。 [GCS]セクションに、Avroファイルを格納するCloud Storageのバケット名を記述します。 コード説明 上記のPythonコードで行うことは以下の通りです。 BigQueryのGA4テーブルをAvro形式でexportします まずBigQueryからCloud Storageにexportし、次にCloud Storageからローカルにダウンロードします。 記事執筆時点で、BigQueryからローカルに直接exportできないため、Cloud Storageを経由しています。 テーブル名が「events_」から始まるテーブルをGA4のテーブルとみなし、まとめてexpo

                                    GA4のテーブルをBigQueryからPostgreSQLにAvroファイル経由でコピーする - Qiita
                                  • Supercharge SQLite with Ruby Functions

                                    An interesting twist in my recent usage of SQLite was the fact that I noticed my research scripts and the database intertwine more. SQLite is unique in that it really lives in-process, unlike standalone database servers. There is a feature to that which does not get used very frequently, but can be indispensable in some situations. By the way, the talk about the system that made me me to explore S

                                    • Towards Inserting One Billion Rows in SQLite Under A Minute - blag

                                      Current Best: 100M rows inserts in 33 seconds. (you can check the source code on Github) Recently, I ran into a situation where I needed a test database with lots of rows and needed it fast. So I did what any programmer would do: wrote a Python script to generate the DB. Unfortunately, it was slow. Really slow. So I did what any programmer would do: went down the rabbit hole of learning more about

                                      • Does OLAP need an ORM?

                                        TL;DR · ORMs have proven to be useful for many developers in the OLTP/transactional stack (Postgres, MySQL, etc). · OLAP/analytical databases like ClickHouse could potentially benefit from ORM abstractions. · Existing transactional ORMs probably shouldn’t be extended to OLAP due to fundamental differences in semantic meaning between OLTP and OLAP. · Moose OLAP (part of MooseStack) is an open sourc

                                          Does OLAP need an ORM?
                                        • The AI-Native Software Engineer

                                          An AI-native software engineer is one who deeply integrates AI into their daily workflow, treating it as a partner to amplify their abilities. This requires a fundamental mindset shift. Instead of thinking “AI might replace me” an AI-native engineer asks for every task: “Could AI help me do this faster, better, or differently?”. The mindset is optimistic and proactive - you see AI as a multiplier

                                            The AI-Native Software Engineer
                                          • Ubuntu 24.04 LTS (Noble Numbat) Release Notes

                                            Noble Numbat Release Notes Table of Contents Introduction New features in 24.04 LTS Known Issues Official flavours More information Introduction These release notes for Ubuntu 24.04 LTS (Noble Numbat) provide an overview of the release and document the known issues with Ubuntu and its flavours. For details of the changes applied since 24.04, please see the 24.04.2 change summary. Support lifespan

                                            • Practical SQL for Data Analysis

                                              Pandas is a very popular tool for data analysis. It comes built-in with many useful features, it's battle tested and widely accepted. However, pandas is not always the best tool for the job. SQL databases have been around since the 1970s. Some of the smartest people in the world worked on making it easy to slice, dice, fetch and manipulate data quickly and efficiently. SQL databases have come such

                                                Practical SQL for Data Analysis
                                              • Bashing JSON into Shape with SQLite

                                                Published on 2022-01-04, 1640 words, 6 minutes to read It is clear that most of the world has decided that they want to use JSON for their public-facing API endpoints. However, most of the time you will need to deal with storage engines that don't deal with JSON very well. This can be confusing to deal with because you need to fit a square peg into a round hole. However, SQLite added JSON function

                                                • Hadoop (Hive, Ambari など) が使う DB を Percona XtraDB Cluster & ProxySQL で冗長化してみた - GMOインターネットグループ グループ研究開発本部

                                                  2018.04.10 Hadoop (Hive, Ambari など) が使う DB を Percona XtraDB Cluster & ProxySQL で冗長化してみた こんにちは。次世代システム研究室のデータベース と Hadoop を担当している M.K. です。 最近 MySQL 系のデータベース (Percona Server / PXC) に関するブログを立て続けに書いていましたが、今回は Hadoop と MySQL 両方に関する内容について書きました。 前々回のブログ:InnoDB だけじゃない!MyRocks (MySQL + RocksDB) ストレージエンジンを試してみた 前回のブログ:MySQLの冗長化を試す!~Percona XtraDB Cluster & ProxySQL & Replication~ Hadoop を構築すると毎回頭を悩ますこととして、H

                                                  • How to Get or Create in PostgreSQL

                                                    "Get or create" is a very common operation for syncing data in the database, but implementing it correctly may be trickier than you may expect. If you ever had to implement it in a real system with real-life load, you may have overlooked potential race conditions, concurrency issues and even bloat! In this article I explore ways to "get ot create" in PostgresSQL. Illustration by Abstrakt Design Ta

                                                      How to Get or Create in PostgreSQL
                                                    • January 2022 (version 1.64)

                                                      Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.64.1: The update addresses these security issues. Update 1.64.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the January 2022 release of Visual Studio Code. There are many updates in this version that we

                                                        January 2022 (version 1.64)
                                                      • Investigating a backdoored PyPi package targeting FastAPI applications | Datadog Security Labs

                                                        Introduction FastAPI is a highly popular Python web framework. On November 23rd, 2022, the Datadog Security Labs team identified a third-party utility Python package on PyPI related to FastAPI, fastapi-toolkit, that has been backdoored by a malicious actor. The attacker inserted a backdoor in the package, adding a FastAPI route allowing a remote attacker to execute arbitrary python code and SQL qu

                                                          Investigating a backdoored PyPi package targeting FastAPI applications | Datadog Security Labs
                                                        • AWS App Runner × FastAPI で作る REST API パターン 3 選 - サーバーワークスエンジニアブログ

                                                          こんにちは。アプリケーションサービス部の河野です。 アプリケーションサービス部では、週に一回、技術発表会という形で、発表者が興味がある技術について自由にプレゼンテーションしています。 その中で「App Runner で REST API 開発するの良いぞ」っていう話をしたので、本ブログでも紹介したいと思います。 導入 コールドスタート問題 デプロイ容量問題 serverless.yaml 書くのツラい問題 ローカルのテストしづらい問題 App Runner とは? FastAPI とは? 環境 パターン①: データストアなし パターン①: 実践 ローカルで動作確認 ECR を作成 イメージをビルド&プッシュ App Runner デプロイ 上手くいかない場合は? パターン②: DynamoDB パターン②: 実践 ローカルで動作確認 fastapi コンテナ localstack コンテナ

                                                            AWS App Runner × FastAPI で作る REST API パターン 3 選 - サーバーワークスエンジニアブログ
                                                          • Sketch of a Post-ORM

                                                            I’ve been writing a lot of database access code as of late. It’s frustrating that in 2023, my choices are still to either write all of the boilerplate by hand, or hand all database access over to some inscrutable “agile” ORM that will become a crippling liability in the 2-3y timescale. This post is about how I want to use databases, from the perspective of an application server developer—not a DBA

                                                              Sketch of a Post-ORM
                                                            • PgBouncer is useful, important, and fraught with peril

                                                              Updated 2024-09-17 to reflect updated PgBouncer support for protocol-level prepared statements 🐘 To start, I want to say that I’m appreciative that PgBouncer exists and the work its open source maintainers put into it. I also love working with PostgreSQL, and I’m thankful for the incredible amount of work and improvements that go into it as well. I also think community and industry enthusiasm aro

                                                                PgBouncer is useful, important, and fraught with peril
                                                              1